The fix for JDK-8007113 removed Class.isAnnotationPresent and replaced it with a default method in an interface implemented by Class. When the resulting jdk build is used to compile test.java which contains a reference to Class.isAnnotationPresent, with option -source 7, an error results saying that method isAnnotationPresent cannot be found in class Class.
The -source 7 causes javac to ignore the default methods in .class files resulting in the error.
This error occurs when a SKIP_BOOT_CYCLE=false build is done using the old build system.
First, the jdk is built with the boot jdk, and then the jdk is rebuilt using the just built jdk. In this rebuild, the langtoold build is run with -source 7 causing the above failure. The -source 7 option results from build.properties setting ant property
boot.javac.source=7
I don't know what happens if a SKIP_BOOT_CYCLE=false build is done with the new build system.
The fix MIGHT be to fix the old langtools build.xml to determine the version of the bootjdk and set the -source option accordingly.
Whether or not the behavior of javac -source 7 .... in the presence of default methods is correct is TBD.
The -source 7 causes javac to ignore the default methods in .class files resulting in the error.
This error occurs when a SKIP_BOOT_CYCLE=false build is done using the old build system.
First, the jdk is built with the boot jdk, and then the jdk is rebuilt using the just built jdk. In this rebuild, the langtoold build is run with -source 7 causing the above failure. The -source 7 option results from build.properties setting ant property
boot.javac.source=7
I don't know what happens if a SKIP_BOOT_CYCLE=false build is done with the new build system.
The fix MIGHT be to fix the old langtools build.xml to determine the version of the bootjdk and set the -source option accordingly.
Whether or not the behavior of javac -source 7 .... in the presence of default methods is correct is TBD.
- relates to
-
JDK-8007113 Upgrade AnnotatedElement.isAnnotionPresent to be a default method
- Closed