8325189: Enable this-escape javac warning in java.base

Reviewed-by: alanb, erikj, naoto, smarks, ihse, joehw, lancea, weijun
This commit is contained in:
Joe Darcy 2024-02-07 20:05:11 +00:00
parent 299a8ee68d
commit fbd15b2087
93 changed files with 151 additions and 2 deletions

View file

@ -260,6 +260,7 @@ public class Throwable implements Serializable {
* <p>The {@link #fillInStackTrace()} method is called to initialize
* the stack trace data in the newly created throwable.
*/
@SuppressWarnings("this-escape")
public Throwable() {
fillInStackTrace();
if (jfrTracing) {
@ -278,6 +279,7 @@ public class Throwable implements Serializable {
* @param message the detail message. The detail message is saved for
* later retrieval by the {@link #getMessage()} method.
*/
@SuppressWarnings("this-escape")
public Throwable(String message) {
fillInStackTrace();
detailMessage = message;
@ -303,6 +305,7 @@ public class Throwable implements Serializable {
* unknown.)
* @since 1.4
*/
@SuppressWarnings("this-escape")
public Throwable(String message, Throwable cause) {
fillInStackTrace();
detailMessage = message;
@ -329,6 +332,7 @@ public class Throwable implements Serializable {
* unknown.)
* @since 1.4
*/
@SuppressWarnings("this-escape")
public Throwable(Throwable cause) {
fillInStackTrace();
detailMessage = (cause==null ? null : cause.toString());
@ -378,6 +382,7 @@ public class Throwable implements Serializable {
* @see ArithmeticException
* @since 1.7
*/
@SuppressWarnings("this-escape")
protected Throwable(String message, Throwable cause,
boolean enableSuppression,
boolean writableStackTrace) {