JDK-8213402 : [Testbug] java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest creates an invalid nest relationship
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-06
  • Updated: 2019-02-22
  • Resolved: 2018-12-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13 b01Fixed
Related Reports
Relates :  
Description
PlatformLoggerBridgeTest uses a custom classloader to load a nested class that is to be a service provider. This results in the enclosing class and the nested class being in two different packages as they have different defining loaders. For a valid nest the nest-host and the nest members must all be in the same package.

As PlatformLoggerBridgeTest does not rely on nestmate access it never validates the nest relationship and so this problem is not seen.

However with future changes to lambda generation using dynamic nestmates (via Lookup.defineClass) the nest-host of the nested class now has to be retrieved, which results in a failure:

java.lang.IncompatibleClassChangeError: Type PlatformLoggerBridgeTest$LogProducerFinder is not a nest member of PlatformLoggerBridgeTest: types are in different packages

The test should be rewritten to use top-level classes rather then nested ones.
Comments
[~dfuchs] the patch looks good to me. I'm glad that the fix is a straight-forwarding refactoring and does not require significant change.
17-12-2018

[~dfuchs] Many thanks for doing this. I hadn't realized there were multiple failing tests here - I've only seen the one. Yes changes to the tests should be pushed to mainline. Thanks.
16-12-2018

The custom class loader defines classes ends with "$LogProducerFinder" whereas all other classes are defined by the application class loader including its enclosing classes. Other test/java/lang/System/LoggerFinder/internal/* tests may have the same issue.
07-11-2018

The following tests are problem listed in valhalla repo nestmates branch until these tests are fixed. diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt --- a/test/jdk/ProblemList.txt +++ b/test/jdk/ProblemList.txt @@ -511,6 +511,15 @@ java/lang/ProcessBuilder/PipelineTest.java 8211844 aix-ppc64 java/lang/ProcessHandle/InfoTest.java 8211847 aix-ppc64 +# jdk_lang failures in nestmates branches + +java/lang/System/LoggerFinder/internal/BaseDefaultLoggerFinderTest/BaseDefaultLoggerFinderTest.java 8213402 generic-all +java/lang/System/LoggerFinder/internal/BaseLoggerBridgeTest/BaseLoggerBridgeTest.java 8213402 generic-all +java/lang/System/LoggerFinder/internal/BasePlatformLoggerTest/BasePlatformLoggerTest.java 8213402 generic-all +java/lang/System/LoggerFinder/internal/LoggerBridgeTest/LoggerBridgeTest.java 8213402 generic-all +java/lang/System/LoggerFinder/internal/LoggerFinderLoaderTest/LoggerFinderLoaderTest.java 8213402 generic-all +java/lang/System/LoggerFinder/internal/PlatformLoggerBridgeTest/PlatformLoggerBridgeTest.java 8213402 generic-all +
07-11-2018