summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSatyam Kandula2012-05-25 11:29:54 (EDT)
committer Jayaprakash Arthanareeswaran2012-06-12 06:39:19 (EDT)
commit972c7f1c4d5a8249e6cf0bbf33078118344b368a (patch)
treeb6726e4ceaf334e4df78c46b447c5105be384b9d
parentbf7f7505c8fbaf610dcfc16c3f38ab20112ea07c (diff)
downloadeclipse.jdt.core-972c7f1c4d5a8249e6cf0bbf33078118344b368a.zip
eclipse.jdt.core-972c7f1c4d5a8249e6cf0bbf33078118344b368a.tar.gz
eclipse.jdt.core-972c7f1c4d5a8249e6cf0bbf33078118344b368a.tar.bz2
Fix for some failing tests in Java8 mode
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java7
-rw-r--r--org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java10
2 files changed, 16 insertions, 1 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 8241a53..30475ce 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
@@ -489,7 +489,10 @@ protected static class JavacTestOptions {
}
Excuse excuseFor(JavacCompiler compiler) {
if (this.minorsFixed != null) {
- if (compiler.compliance == ClassFileConstants.JDK1_7) {
+ if (compiler.compliance == ClassFileConstants.JDK1_8) {
+ return this.minorsFixed[5] > compiler.minor || this.minorsFixed[5] < 0 ?
+ this : null;
+ } else if (compiler.compliance == ClassFileConstants.JDK1_7) {
return this.minorsFixed[4] > compiler.minor || this.minorsFixed[4] < 0 ?
this : null;
} else if (compiler.compliance == ClassFileConstants.JDK1_6) {
@@ -841,6 +844,8 @@ protected static class JavacTestOptions {
buffer.append("\" -1.6 -proc:none");
} else if (this.complianceLevel == ClassFileConstants.JDK1_7) {
buffer.append("\" -1.7 -proc:none");
+ } else if (this.complianceLevel == ClassFileConstants.JDK1_8) {
+ buffer.append("\" -1.8 -proc:none");
}
buffer
.append(" -preserveAllLocals -nowarn -g -classpath \"")
diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java
index 4cbb52e..52a8c7d 100644
--- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java
+++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java
@@ -5,6 +5,10 @@
* 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
*******************************************************************************/
@@ -56,6 +60,12 @@ public CodeSnippetClassFile(
this.header[this.headerOffset++] = (byte) (0xCAFEBABEL >> 0);
long targetVersion = this.targetJDK = this.referenceBinding.scope.compilerOptions().targetJDK;
+ if (this.targetJDK == ClassFileConstants.JDK1_8) {
+ //TODO JAVA8: Version number is not yet updated in the java8 beta...
+ //Remove this after it is upgraded
+ targetVersion = this.targetJDK = ClassFileConstants.JDK1_7;
+ }
+ //TODO: Might have to update even for CLDC_1_1
this.header[this.headerOffset++] = (byte) (targetVersion >> 8); // minor high
this.header[this.headerOffset++] = (byte) (targetVersion >> 0); // minor low
this.header[this.headerOffset++] = (byte) (targetVersion >> 24); // major high