Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorssankaran2013-02-16 23:36:26 +0000
committerssankaran2013-02-16 23:36:26 +0000
commit63b001f83264125c7dd42160689ada7c16b8afb5 (patch)
tree16ddbba72ce1fc7bcb007b1da6923dc2ee3b8e93
parent1eeba055c4a858ddea83f6c85864678280808173 (diff)
downloadeclipse.jdt.core-63b001f83264125c7dd42160689ada7c16b8afb5.tar.gz
eclipse.jdt.core-63b001f83264125c7dd42160689ada7c16b8afb5.tar.xz
eclipse.jdt.core-63b001f83264125c7dd42160689ada7c16b8afb5.zip
Changes for 1.8 as a language level in JavaCore.
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java5
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java4
5 files changed, 31 insertions, 6 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
index 5b219f41b8..a1a39f6f2c 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java
@@ -243,6 +243,8 @@ static class JavacCompiler {
this.version = JavaCore.VERSION_1_6;
} else if (rawVersion.indexOf("1.7") != -1) {
this.version = JavaCore.VERSION_1_7;
+ } else if (rawVersion.indexOf("1.8") != -1) {
+ this.version = JavaCore.VERSION_1_8;
} else {
throw new RuntimeException("unknown javac version: " + rawVersion);
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
index 7ce2a10ee2..572fe0a13e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -88,7 +88,7 @@ public interface ClassFileConstants {
int MAJOR_VERSION_1_5 = 49;
int MAJOR_VERSION_1_6 = 50;
int MAJOR_VERSION_1_7 = 51;
- int MAJOR_VERSION_1_8 = 52; //TODO JAVA8: This probably needs to change
+ int MAJOR_VERSION_1_8 = 52;
int MINOR_VERSION_0 = 0;
int MINOR_VERSION_1 = 1;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java
index 8ae6fdc062..79c9b6930e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -387,7 +387,7 @@ public final class JavaConventions {
*
* <p>The source level and compliance level values should be taken from the constant defined inside
* {@link JavaCore} class. The constants are named <code>JavaCore#VERSION_1_x</code>, x being set
- * between '1' and '7'.
+ * between '1' and '8'.
* </p>
*
* @param name the name of a type
@@ -407,6 +407,7 @@ public final class JavaConventions {
* @see JavaCore#VERSION_1_5
* @see JavaCore#VERSION_1_6
* @see JavaCore#VERSION_1_7
+ * @see JavaCore#VERSION_1_8
*/
public static IStatus validateJavaTypeName(String name, String sourceLevel, String complianceLevel) {
if (name == null) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
index 3985932f6c..f22b799081 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
@@ -1,10 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
* http://www.eclipse.org/legal/epl-v10.html
*
+ * 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.
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* IBM Corporation - added the following constants:
@@ -98,6 +102,7 @@
* COMPILER_INHERIT_NULL_ANNOTATIONS
* COMPILER_PB_NONNULL_PARAMETER_ANNOTATION_DROPPED
* COMPILER_PB_SYNTACTIC_NULL_ANALYSIS_FOR_FIELDS
+ * Jesper S Moller - Contributions for bug 381345 : [1.8] Take care of the Java 8 major version
*******************************************************************************/
package org.eclipse.jdt.core;
@@ -2644,6 +2649,12 @@ public final class JavaCore extends Plugin {
public static final String VERSION_1_7 = "1.7"; //$NON-NLS-1$
/**
* Configurable option value: {@value}.
+ * @since 3.9
+ * @category OptionValue
+ */
+ public static final String VERSION_1_8 = "1.8"; //$NON-NLS-1$
+ /**
+ * Configurable option value: {@value}.
* @since 3.4
* @category OptionValue
*/
@@ -5560,6 +5571,15 @@ public final class JavaCore extends Plugin {
options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR);
options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR);
options.put(JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE, JavaCore.ENABLED);
+ break;
+ case ClassFileConstants.MAJOR_VERSION_1_8:
+ options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8);
+ options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
+ options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8);
+ options.put(JavaCore.COMPILER_PB_ASSERT_IDENTIFIER, JavaCore.ERROR);
+ options.put(JavaCore.COMPILER_PB_ENUM_IDENTIFIER, JavaCore.ERROR);
+ options.put(JavaCore.COMPILER_CODEGEN_INLINE_JSR_BYTECODE, JavaCore.ENABLED);
+ break;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java
index 067a219a2e..9088ed8225 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -769,6 +769,8 @@ public class Disassembler extends ClassFileBytesDisassembler {
versionNumber = JavaCore.VERSION_1_6;
} else if (minorVersion == 0 && majorVersion == 51) {
versionNumber = JavaCore.VERSION_1_7;
+ } else if (minorVersion == 0 && majorVersion == 52) {
+ versionNumber = JavaCore.VERSION_1_8;
}
buffer.append(
Messages.bind(Messages.classfileformat_versiondetails,

Back to the top