Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrikanth2012-06-27 02:47:06 +0000
committerSrikanth2012-06-27 02:47:06 +0000
commit74fed5493a5e05f9b2b1c69610952bdae1f33d7e (patch)
tree79ac7f925ce4f92de8f1c859120eb1a0a02610cf
parent59758b3ac964ea48fbbbf5d314c8ed8b19dc60bb (diff)
downloadeclipse.jdt.core-74fed5493a5e05f9b2b1c69610952bdae1f33d7e.tar.gz
eclipse.jdt.core-74fed5493a5e05f9b2b1c69610952bdae1f33d7e.tar.xz
eclipse.jdt.core-74fed5493a5e05f9b2b1c69610952bdae1f33d7e.zip
Fixed bug 383499: [1.8][compiler] Parser.buildFileForCompliance missing
1.6, 1.7 and 1.8 modes.
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java6
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java6
2 files changed, 10 insertions, 2 deletions
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 a21b681d8d..41a1b27f28 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, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 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
@@ -84,6 +84,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; // Oracle has not updated this as of JDK8b39, i.e it still says 51.
int MINOR_VERSION_0 = 0;
int MINOR_VERSION_1 = 1;
@@ -91,7 +92,7 @@ public interface ClassFileConstants {
int MINOR_VERSION_3 = 3;
int MINOR_VERSION_4 = 4;
- // JDK 1.1 -> 1.7, comparable value allowing to check both major/minor version at once 1.4.1 > 1.4.0
+ // JDK 1.1 -> 1.8, comparable value allowing to check both major/minor version at once 1.4.1 > 1.4.0
// 16 unsigned bits for major, then 16 bits for minor
long JDK1_1 = ((long)ClassFileConstants.MAJOR_VERSION_1_1 << 16) + ClassFileConstants.MINOR_VERSION_3; // 1.1. is 45.3
long JDK1_2 = ((long)ClassFileConstants.MAJOR_VERSION_1_2 << 16) + ClassFileConstants.MINOR_VERSION_0;
@@ -100,6 +101,7 @@ public interface ClassFileConstants {
long JDK1_5 = ((long)ClassFileConstants.MAJOR_VERSION_1_5 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK1_6 = ((long)ClassFileConstants.MAJOR_VERSION_1_6 << 16) + ClassFileConstants.MINOR_VERSION_0;
long JDK1_7 = ((long)ClassFileConstants.MAJOR_VERSION_1_7 << 16) + ClassFileConstants.MINOR_VERSION_0;
+ long JDK1_8 = ((long)ClassFileConstants.MAJOR_VERSION_1_8 << 16) + ClassFileConstants.MINOR_VERSION_0;
/*
* cldc1.1 is 45.3, but we modify it to be different from JDK1_1.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
index a39c850a8d..6e7a0b5cd5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java
@@ -166,6 +166,12 @@ public class Parser implements ParserBasicInformation, TerminalTokens, Operator
compliance = ClassFileConstants.JDK1_4;
} else if("1.5".equals(token)) { //$NON-NLS-1$
compliance = ClassFileConstants.JDK1_5;
+ } else if("1.6".equals(token)) { //$NON-NLS-1$
+ compliance = ClassFileConstants.JDK1_6;
+ } else if("1.7".equals(token)) { //$NON-NLS-1$
+ compliance = ClassFileConstants.JDK1_7;
+ } else if("1.8".equals(token)) { //$NON-NLS-1$
+ compliance = ClassFileConstants.JDK1_8;
} else if("recovery".equals(token)) { //$NON-NLS-1$
compliance = ClassFileConstants.JDK_DEFERRED;
}

Back to the top