RFR: 8371682: Suppress javac warning from ThreadPoolExecutorSubclassTest.java

Jaikiran Pai jpai at openjdk.org
Sat Nov 15 04:53:04 UTC 2025


On Thu, 13 Nov 2025 02:31:31 GMT, SendaoYan <syan at openjdk.org> wrote:

> Hi all,
> 
> In JDK 11, ThreadPoolExecutor.finalize() was specified to do nothing, leaving the finalize() method empty by [JDK-8371748](https://bugs.openjdk.org/browse/JDK-8371748), so I think it's safety to remove finalize() in testFinalizeMethodCallsSuperFinalize for test/jdk/java/util/concurrent/tck/ThreadPoolExecutorSubclassTest.java.
> 
> This PR also remove unnecessary '@SuppressWarnings("removal")' in test/jdk/java/util/concurrent/tck/JSR166TestCase.java and test/jdk/java/util/concurrent/tck/ExecutorsTest.java.
> 
> Change has been verified locally on linux-x64 by run test java/util/concurrent/tck/JSR166TestCase.java#default. Test-fix only, no risk,

The changes look good to me but I think Hannes' question is valid.

> > What does `testFinalizeMethodCallsSuperFinalize` test now?
> 
> I have verified java/util/concurrent/tck/JSR166TestCase.java#default locally, test still run passed. Test java/util/concurrent/tck/JSR166TestCase.java#default will invoke all the junit tests in java/util/concurrent/tck directory.

Is the testFinalizeMethodCallsSuperFinalize() needed or can it be removed? With the changes in this PR, I don't see what this method tests, especially given its name. It's a different matter that even without the changes to this PR, I am not sure what was being tested/asserted in that test method.

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

PR Comment: https://git.openjdk.org/jdk/pull/28278#issuecomment-3535949036


More information about the core-libs-dev mailing list