Bug 480992 - [1.9] Versioning Changes support - JEP 223

Change-Id: I6e1822ac496e937c5e862bdfe066968234a10310
diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JavaModelUtil.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JavaModelUtil.java
index 1e958cd..42d9a69 100644
--- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JavaModelUtil.java
+++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JavaModelUtil.java
@@ -75,7 +75,7 @@
 	 */
 	public static final String VERSION_LATEST;
 	static {
-		VERSION_LATEST= JavaCore.VERSION_1_9; // make sure it is not inlined
+		VERSION_LATEST= JavaCore.VERSION_9; // make sure it is not inlined
 	}
 	
 	/**
@@ -782,7 +782,7 @@
 	}
 
 	public static boolean is19OrHigher(String compliance) {
-		return !isVersionLessThan(compliance, JavaCore.VERSION_1_9);
+		return !isVersionLessThan(compliance, JavaCore.VERSION_9);
 	}
 	
 	/**
@@ -860,8 +860,8 @@
 		String version= vMInstall.getJavaVersion();
 		if (version == null) {
 			return defaultCompliance;
-		} else if (version.startsWith(JavaCore.VERSION_1_9)) {
-			return JavaCore.VERSION_1_9;
+		} else if (version.startsWith(JavaCore.VERSION_9)) {
+			return JavaCore.VERSION_9;
 		} else if (version.startsWith(JavaCore.VERSION_1_8)) {
 			return JavaCore.VERSION_1_8;
 		} else if (version.startsWith(JavaCore.VERSION_1_7)) {
@@ -892,8 +892,8 @@
 		
 		// fallback:
 		String desc= executionEnvironment.getId();
-		if (desc.indexOf(JavaCore.VERSION_1_9) != -1) {
-			return JavaCore.VERSION_1_9;
+		if (desc.indexOf(JavaCore.VERSION_9) != -1) {
+			return JavaCore.VERSION_9;
 		} else if (desc.indexOf(JavaCore.VERSION_1_8) != -1) {
 			return JavaCore.VERSION_1_8;
 		} else if (desc.indexOf(JavaCore.VERSION_1_7) != -1) {
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ComplianceConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ComplianceConfigurationBlock.java
index f015c26..fcb0425 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ComplianceConfigurationBlock.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ComplianceConfigurationBlock.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -125,7 +125,7 @@
 	private static final String VERSION_1_6= JavaCore.VERSION_1_6;
 	private static final String VERSION_1_7= JavaCore.VERSION_1_7;
 	private static final String VERSION_1_8= JavaCore.VERSION_1_8;
-	private static final String VERSION_1_9= JavaCore.VERSION_1_9;
+	private static final String VERSION_9= JavaCore.VERSION_9;
 	private static final String VERSION_JSR14= "jsr14"; //$NON-NLS-1$
 
 	private static final String ERROR= JavaCore.ERROR;
@@ -265,7 +265,7 @@
 	private Composite createComplianceTabContent(Composite folder) {
 
 		final String[] complianceVersions= new String[] { VERSION_1_3, VERSION_1_4,
-				VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_1_9 };
+				VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9 };
 		final String[] complianceLabels= new String[] {
 			PreferencesMessages.ComplianceConfigurationBlock_version13,
 			PreferencesMessages.ComplianceConfigurationBlock_version14,
@@ -293,14 +293,14 @@
 			targetVersions= append(targetVersions, ComplianceConfigurationBlock.VERSION_JSR14);
 			targetLabels= append(targetLabels, ComplianceConfigurationBlock.VERSION_JSR14);
 		}
-		if (ComplianceConfigurationBlock.VERSION_1_9.equals(getValue(PREF_CODEGEN_TARGET_PLATFORM))) {
+		if (ComplianceConfigurationBlock.VERSION_9.equals(getValue(PREF_CODEGEN_TARGET_PLATFORM))) {
 			//TODO(BETA_JAVA9) at the moment, runtime doesn't support a new class file version
-			targetVersions= append(targetVersions, ComplianceConfigurationBlock.VERSION_1_9);
+			targetVersions= append(targetVersions, ComplianceConfigurationBlock.VERSION_9);
 			targetLabels= append(targetLabels, PreferencesMessages.ComplianceConfigurationBlock_version19);
 		}
 		
 		String[] sourceVersions= new String[] { VERSION_1_3, VERSION_1_4,
-				VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_1_9 };
+				VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9 };
 		String[] sourceLabels= new String[] {
 				PreferencesMessages.ComplianceConfigurationBlock_version13,
 				PreferencesMessages.ComplianceConfigurationBlock_version14,
@@ -309,9 +309,9 @@
 				PreferencesMessages.ComplianceConfigurationBlock_version17,
 				PreferencesMessages.ComplianceConfigurationBlock_version18,
 		};
-		if (ComplianceConfigurationBlock.VERSION_1_9.equals(getValue(PREF_SOURCE_COMPATIBILITY))) {
+		if (ComplianceConfigurationBlock.VERSION_9.equals(getValue(PREF_SOURCE_COMPATIBILITY))) {
 			//TODO(BETA_JAVA9) at the moment, there's no new Java language feature
-			sourceVersions= append(sourceVersions, ComplianceConfigurationBlock.VERSION_1_9);
+			sourceVersions= append(sourceVersions, ComplianceConfigurationBlock.VERSION_9);
 			sourceLabels= append(sourceLabels, PreferencesMessages.ComplianceConfigurationBlock_version19);
 		}
 
@@ -636,7 +636,7 @@
 			
 			//TODO: Remove once Java SE 9 has been shipped:
 			String selectedCompliance= getValue(PREF_COMPLIANCE);
-			if (VERSION_1_9.equals(selectedCompliance)) {
+			if (VERSION_9.equals(selectedCompliance)) {
 				fJRE50InfoText.setText("This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP."); //$NON-NLS-1$
 				isVisible= true;
 			}
@@ -682,7 +682,7 @@
 
 		// target must not be smaller than source
 		if (!VERSION_1_3.equals(source) && JavaModelUtil.isVersionLessThan(target, source)) {
-			if (VERSION_1_9.equals(source) && VERSION_1_8.equals(target)) {
+			if (VERSION_9.equals(source) && VERSION_1_8.equals(target)) {
 				// TODO(BETA_JAVA9): not clear yet whether there will be a 1.9 class file version. Allow mismatch for now:
 				return status;
 			}
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCodeScanner.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCodeScanner.java
index 8448eb7..ce4b185 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCodeScanner.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCodeScanner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2015 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -539,7 +539,7 @@
 
 	private List<IRule> create19ModuleInfoRules(Token defaultToken, String version) {
 		// Add word rule for new keywords
-		VersionedWordMatcher j19ModuleInfoMatcher= new VersionedWordMatcher(defaultToken, JavaCore.VERSION_1_9, version);
+		VersionedWordMatcher j19ModuleInfoMatcher= new VersionedWordMatcher(defaultToken, JavaCore.VERSION_9, version);
 		Token token= getToken(IJavaColorConstants.JAVA_KEYWORD);
 		for (int i= 0; i < fgJava19ModuleInfoKeywords.length; i++)
 			j19ModuleInfoMatcher.addWord(fgJava19ModuleInfoKeywords[i], token);