diff --git a/make/modules/jdk.compiler/Java.gmk b/make/modules/jdk.compiler/Java.gmk index cabf0b9ba48..49572b6efb9 100644 --- a/make/modules/jdk.compiler/Java.gmk +++ b/make/modules/jdk.compiler/Java.gmk @@ -23,8 +23,6 @@ # questions. # -DISABLED_WARNINGS_java += this-escape - DOCLINT += -Xdoclint:all/protected \ '-Xdoclint/package:-com.sun.tools.*,-jdk.internal.*,sun.tools.serialver.resources.*' JAVAC_FLAGS += -XDstringConcat=inline diff --git a/make/modules/jdk.jdeps/Java.gmk b/make/modules/jdk.jdeps/Java.gmk index 99db76fe36f..914b0c66587 100644 --- a/make/modules/jdk.jdeps/Java.gmk +++ b/make/modules/jdk.jdeps/Java.gmk @@ -25,8 +25,6 @@ COPY += .txt -DISABLED_WARNINGS_java += this-escape - CLEAN_FILES += $(wildcard \ $(TOPDIR)/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/resources/*.properties \ $(TOPDIR)/src/jdk.jdeps/share/classes/com/sun/tools/javap/resources/*.properties) diff --git a/make/modules/jdk.jshell/Java.gmk b/make/modules/jdk.jshell/Java.gmk index 1a8d779d9ef..a9db351c333 100644 --- a/make/modules/jdk.jshell/Java.gmk +++ b/make/modules/jdk.jshell/Java.gmk @@ -23,6 +23,4 @@ # questions. # -DISABLED_WARNINGS_java += this-escape - COPY += .jsh .properties diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java index 4dcd6d6d8d3..aeb479646ef 100644 --- a/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java +++ b/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Dependencies.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,6 +67,7 @@ public class Dependencies { /** * Thrown when a class file cannot be found. */ + @SuppressWarnings("this-escape") public static class ClassFileNotFoundException extends Exception { private static final long serialVersionUID = 3632265927794475048L; @@ -86,6 +87,7 @@ public class Dependencies { /** * Thrown when an exception is found processing a class file. */ + @SuppressWarnings("this-escape") public static class ClassFileError extends Error { private static final long serialVersionUID = 4111110813961313203L; diff --git a/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java b/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java index d06d587f277..9310e0fd49a 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/execution/JdiInitiator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,6 +81,7 @@ public class JdiInitiator { * @param customConnectorArgs custom arguments passed to the connector. * These are JDI com.sun.jdi.connect.Connector arguments. */ + @SuppressWarnings("this-escape") public JdiInitiator(int port, List remoteVMOptions, String remoteAgent, boolean isLaunch, String host, int timeout, Map customConnectorArgs) { diff --git a/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java b/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java index fb6e94d4f70..13514a1c5cf 100644 --- a/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java +++ b/src/jdk.jshell/share/classes/jdk/jshell/spi/ExecutionControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -428,6 +428,7 @@ public interface ExecutionControl extends AutoCloseable { private final String causeExceptionClass; + @SuppressWarnings("this-escape") public UserException(String message, String causeExceptionClass, StackTraceElement[] stackElements) { super(message); this.causeExceptionClass = causeExceptionClass; @@ -467,6 +468,7 @@ public interface ExecutionControl extends AutoCloseable { * @param id An internal identifier of the specific method * @param stackElements the stack trace */ + @SuppressWarnings("this-escape") public ResolutionException(int id, StackTraceElement[] stackElements) { super("resolution exception: " + id); this.id = id;