JDK-8141104 : jdk.jshell.TaskFactory code for java.specification.version = 1.9 should be adjusted for Verona
  • Type: Bug
  • Component: tools
  • Sub-Component: jshell
  • Affected Version: 9-repo-verona
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-11-01
  • Updated: 2016-02-25
  • Resolved: 2015-11-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 9
9Fixed
Related Reports
Relates :  
Description
JEP 223 (http://openjdk.java.net/jeps/223) New Version-String Specification (aka Verona) changes the return value for various system properties including java.specification.version.  The code in jdk.jshell.TaskFactory should be altered to detect the new version ("9" instead of "1.9") as follows:

diff -r 49da3649b796 src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java
--- a/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java  Fri Oct 30 10:29:03 2015 -0700
+++ b/src/jdk.jshell/share/classes/jdk/jshell/TaskFactory.java  Sun Nov 01 11:24:58 2015 -0800
@@ -80,7 +80,7 @@
         if (compiler == null) {
             throw new UnsupportedOperationException("Compiler not available, must be run with full JDK 9.");
         }
-        if (!System.getProperty("java.specification.version").equals("1.9"))  {
+        if (!System.getProperty("java.specification.version").equals("9"))  {
             throw new UnsupportedOperationException("Wrong compiler, must be run with full JDK 9.");
         }
         this.fileManager = new MemoryFileManager(

The following regression test fails on all platforms due to this bug:

jdk/jshell/AnalysisTest.java

Comments
The following langtools tests fail due to this on Verona build: RULE "jdk/jshell/AnalysisTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/AnalysisTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/ClassMembersTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/ClassMembersTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/ClassPathTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/ClassPathTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/ClassesTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/ClassesTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/CommandCompletionTest.java" Exception java.lang.AssertionError: Repl tool died with exception RULE "jdk/jshell/CommandCompletionTest.java" Exception java.lang.Exception: failures: ... RULE "jdk/jshell/CommandCompletionTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/CompletenessTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/CompletenessTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/CompletionSuggestionTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/CompletionSuggestionTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/DropTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/DropTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/EmptyTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/EmptyTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/ErrorTranslationTest.java" Exception java.lang.AssertionError: Repl tool died with exception RULE "jdk/jshell/ErrorTranslationTest.java" Exception java.lang.Exception: failures: ... RULE "jdk/jshell/ErrorTranslationTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/ExceptionsTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/ExceptionsTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/HistoryTest.java" Exception java.lang.Exception: failures: ... RULE "jdk/jshell/HistoryTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/IOTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/IOTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/IdGeneratorTest.java" Exception java.lang.Exception: failures: ... RULE "jdk/jshell/IdGeneratorTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/IgnoreTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/IgnoreTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/IllegalArgumentExceptionTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/IllegalArgumentExceptionTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/ImportTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/ImportTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/JShellStateClosedTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/JShellStateClosedTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/KullaCompletenessStressTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/KullaCompletenessStressTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/MethodsTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/MethodsTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/ModifiersTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/ModifiersTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/NullTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/NullTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/RejectedFailedTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/RejectedFailedTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/ReplaceTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/ReplaceTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/ShutdownTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/ShutdownTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/SimpleRegressionTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/SimpleRegressionTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/SnippetStatusListenerTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/SnippetStatusListenerTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/SnippetTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/SnippetTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/StopExecutionTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/StopExecutionTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/TypeNameTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/TypeNameTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ... RULE "jdk/jshell/VariablesTest.java" Exception java.lang.ExceptionInInitializerError RULE "jdk/jshell/VariablesTest.java" Exception java.lang.UnsupportedOperationException: Wrong compiler, must be run with full JDK ...
25-11-2015