On Fri, 2 Feb 2024 23:36:41 GMT, Joe Darcy <da...@openjdk.org> wrote:

> After the "this-escape" lint warning was added to javac (JDK-8015831), the 
> base module was not updated to be able to compile with this warning enabled. 
> This PR makes the necessary changes to allow the base module to build with 
> the warning enabled.

> Build changes look fine, but there is really a _lot_ of places where the 
> warning is individually disabled. This indicates either that the warning is 
> too broad, or that the code base is potentially very buggy; neither of which 
> sounds very good. :(

I deliberately choose to suppress the warning at each constructor location 
rather than at the class level so there are more SuppressWarnings annotations 
than strictly needed to get the build to be clean. However, I thought limiting 
the scope of the annotations was preferable for several reasons, including more 
precisely indicating where any code updates are needed.

This is a new warning run over old code, in some cases very old code. I don't 
find it surprising that there were several hundred instances of this warning in 
java.base given the amount of code there.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17692#issuecomment-1930451875

Reply via email to