Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShankha Banerjee2013-11-11 11:49:52 +0000
committerJayaprakash Arthanareeswaran2013-11-11 11:58:34 +0000
commit8263b1bf4e0979f16664b3ec7a3f63f9c444d8c1 (patch)
tree3b11c0cf7cef01ba4cfcf54099aa26d3a5f1acec
parent57b3e1abeb63c771e6bdc37b05f8550c215d97c4 (diff)
downloadeclipse.jdt.core-8263b1bf4e0979f16664b3ec7a3f63f9c444d8c1.tar.gz
eclipse.jdt.core-8263b1bf4e0979f16664b3ec7a3f63f9c444d8c1.tar.xz
eclipse.jdt.core-8263b1bf4e0979f16664b3ec7a3f63f9c444d8c1.zip
Bug 418920 - [1.8] Failing tests with JRE8
Signed-off-by: Shankha Banerjee <shankhba@in.ibm.com>
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors.jarbin195723 -> 195722 bytes
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/elementutils/ElementUtilsProc.java6
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/typeutils/TypeUtilsProc.java20
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/resources/targets/model/pd/Outer.java16
-rw-r--r--org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.java15
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java3
6 files changed, 34 insertions, 26 deletions
diff --git a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors.jar b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors.jar
index b086672528..cda42270c2 100644
--- a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors.jar
+++ b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors.jar
Binary files differ
diff --git a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/elementutils/ElementUtilsProc.java b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/elementutils/ElementUtilsProc.java
index a03ef8a9ae..caf3d0f36c 100644
--- a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/elementutils/ElementUtilsProc.java
+++ b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/elementutils/ElementUtilsProc.java
@@ -471,8 +471,8 @@ public class ElementUtilsProc extends BaseProcessor
"\n" +
" Javadoc on _fieldT1_private\n" +
" this line starts with two spaces, no asterisk\n" +
- " This line starts, contains\tand ends with a tab\t\n" +
- " This line starts with a space, tab, space, tab, space\n");
+ "\tThis line starts, contains\tand ends with a tab\t\n" +
+ " \t \t This line starts with a space, tab, space, tab, space\n");
nameToDoc.put("fieldInt", null);
nameToDoc.put("method_T1", " Javadoc on F.method_T1\n");
nameToDoc.put("method_String", null);
@@ -481,7 +481,7 @@ public class ElementUtilsProc extends BaseProcessor
nameToDoc.put("foo", "\n Creates a new instance of AllChecks \n");
nameToDoc.put("bar", " @bar\t(int)\n");
nameToDoc.put("bar2", "\t@bar2(int)\n");
- nameToDoc.put("m", " Method\tm\n");
+ nameToDoc.put("m", "\t\tMethod\tm\n");
nameToDoc.put("m1", "This is a comment for the method m1,\n" +
" it is on two lines\n");
nameToDoc.put("m2", "Another comment - starts on first line and\n" +
diff --git a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/typeutils/TypeUtilsProc.java b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/typeutils/TypeUtilsProc.java
index 9485f8656d..fc52f8f8dd 100644
--- a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/typeutils/TypeUtilsProc.java
+++ b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/typeutils/TypeUtilsProc.java
@@ -273,25 +273,25 @@ public class TypeUtilsProc extends BaseProcessor
private boolean examineGetDeclaredTypeNested() {
TypeElement stringDecl = _elementUtils.getTypeElement(String.class.getName());
TypeElement numberDecl = _elementUtils.getTypeElement(Number.class.getName());
- TypeElement mapDecl = _elementUtils.getTypeElement("java.util.HashMap");
- TypeElement iterDecl = _elementUtils.getTypeElement("java.util.HashMap.HashIterator");
+ TypeElement elementOuter = _elementUtils.getTypeElement("targets.model.pd.Outer");
+ TypeElement elementInner = _elementUtils.getTypeElement("targets.model.pd.Outer.Inner");
DeclaredType stringType = _typeUtils.getDeclaredType(stringDecl);
DeclaredType numberType = _typeUtils.getDeclaredType(numberDecl);
ArrayType numberArrayType = _typeUtils.getArrayType(numberType);
- // HashMap<String, Number[]>
- DeclaredType outerType = _typeUtils.getDeclaredType(mapDecl, stringType, numberArrayType);
-
- // HashMap<String, Number[]>.HashIterator<Number[]>
- DeclaredType decl = _typeUtils.getDeclaredType(outerType, iterDecl, new TypeMirror[] { numberArrayType });
-
+ // Outer<T1, T2> ---> Outer<String, Number[]>
+ DeclaredType outerType = _typeUtils.getDeclaredType(elementOuter, stringType, numberArrayType);
+
+ // Outer<T1, T2>.Inner<T2> ---> Outer<String, Number[]>.Inner<Number[]>
+ DeclaredType decl = _typeUtils.getDeclaredType(outerType, elementInner, new TypeMirror[] { numberArrayType });
+
List<? extends TypeMirror> args = decl.getTypeArguments();
if (args.size() != 1) {
- reportError("Map<String, Number[]>.EntryIterator<Number[]> should have one argument but decl.getTypeArguments() returned " + args.size());
+ reportError("Outer<String, Number[]>.Inner<Number[]> should have one argument but decl.getTypeArguments() returned " + args.size());
return false;
}
if (!_typeUtils.isSameType(numberArrayType, args.get(0))) {
- reportError("First arg of Map<String, Number[]>.EntryIterator<Number[]> was expected to be Number[], but was: " + args.get(0));
+ reportError("First arg of Outer<String, Number[]>.Inner<Number[]> was expected to be Number[], but was: " + args.get(0));
return false;
}
return true;
diff --git a/org.eclipse.jdt.compiler.apt.tests/resources/targets/model/pd/Outer.java b/org.eclipse.jdt.compiler.apt.tests/resources/targets/model/pd/Outer.java
new file mode 100644
index 0000000000..a878df6377
--- /dev/null
+++ b/org.eclipse.jdt.compiler.apt.tests/resources/targets/model/pd/Outer.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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.
+ *******************************************************************************/
+package targets.model.pd;
+
+class Outer<T1, T2> {
+ class Inner<T3> {}
+}
diff --git a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.java b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.java
index 2bf2c55f06..e05bb1672d 100644
--- a/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.java
+++ b/org.eclipse.jdt.compiler.apt/src/org/eclipse/jdt/internal/compiler/apt/model/ElementsImpl.java
@@ -456,17 +456,6 @@ public class ElementsImpl implements Elements {
for (int i = 0, max = chars.length; i < max; i++) {
char c = chars[i];
switch(c) {
- case '\t' :
- if (starsIndex == -1) {
- if (recordLeadingWhitespaces) {
- leadingWhitespaces += 8;
- } else {
- sb.append(c);
- }
- } else if (i >= starsIndex) {
- sb.append(c);
- }
- break;
case ' ' :
if (starsIndex == -1) {
if (recordLeadingWhitespaces) {
@@ -498,6 +487,10 @@ public class ElementsImpl implements Elements {
}
leadingWhitespaces = 0;
sb.append(c);
+ } else if (c == '\t') {
+ if (i >= starsIndex) {
+ sb.append(c);
+ }
} else if (c != '*' || i > starsIndex) {
sb.append(c);
}
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java
index bab457714b..7b618e4ff8 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/RunAllJava8Tests.java
@@ -23,7 +23,6 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.eclipse.jdt.compiler.apt.tests.Java8ElementsTests;
import org.eclipse.jdt.core.tests.compiler.parser.ComplianceDiagnoseTest;
import org.eclipse.jdt.core.tests.dom.ASTConverter15JLS8Test;
import org.eclipse.jdt.core.tests.dom.ASTConverter18Test;
@@ -50,6 +49,7 @@ public class RunAllJava8Tests extends TestCase {
FormatterJSR335Tests.class,
FormatterJSR308Tests.class,
JavaSearchBugs8Tests.class,
+ org.eclipse.jdt.compiler.apt.tests.AllTests.class,
};
}
@@ -63,7 +63,6 @@ public class RunAllJava8Tests extends TestCase {
ASTConverter18Test.class,
ASTRewritingTest.class,
TypeBindingTests308.class,
- Java8ElementsTests.class,
};
}

Back to the top