Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Arthanareeswaran2018-03-12 08:10:26 -0400
committerJay Arthanareeswaran2018-03-14 00:02:21 -0400
commit304a1635ec412ada95b23dc1c7c1226b0b600fd6 (patch)
tree29e015a0ef8566b5ec338f335ea4aec53177ff89 /org.eclipse.jdt.compiler.apt.tests
parentf2340ce0cbbf0215b456f958cfc9a5ac47a03115 (diff)
downloadeclipse.jdt.core-304a1635ec412ada95b23dc1c7c1226b0b600fd6.tar.gz
eclipse.jdt.core-304a1635ec412ada95b23dc1c7c1226b0b600fd6.tar.xz
eclipse.jdt.core-304a1635ec412ada95b23dc1c7c1226b0b600fd6.zip
Bug 531717 - TypesImpl.erasure() should not throw CCE for NoType and
NullType Change-Id: I15803f8171f60905b5b6affaefe341d383d34c7c Signed-off-by: Jay Arthanareeswaran <jarthana@in.ibm.com> (cherry picked from commit 9d6af21769df88995beecbec9e93cceeea7e81da)
Diffstat (limited to 'org.eclipse.jdt.compiler.apt.tests')
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jarbin232878 -> 233186 bytes
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java8ElementProcessor.java11
-rw-r--r--org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java8ElementsTests.java4
3 files changed, 14 insertions, 1 deletions
diff --git a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
index fb1d9f4e95..1e01a671f2 100644
--- a/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
+++ b/org.eclipse.jdt.compiler.apt.tests/lib/apttestprocessors8.jar
Binary files differ
diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java8ElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java8ElementProcessor.java
index 028b997c31..809ea6a05f 100644
--- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java8ElementProcessor.java
+++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java8ElementProcessor.java
@@ -42,6 +42,8 @@ import javax.lang.model.element.VariableElement;
import javax.lang.model.type.ArrayType;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.ExecutableType;
+import javax.lang.model.type.NoType;
+import javax.lang.model.type.NullType;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.ElementFilter;
@@ -1057,7 +1059,14 @@ public class Java8ElementProcessor extends BaseProcessor {
assertEquals("Parameter type should be same", param.asType(), asType2);
}
}
-
+ public void testBug531717() {
+ NoType noType = _typeUtils.getNoType(TypeKind.NONE);
+ TypeMirror erasure = _typeUtils.erasure(noType);
+ assertSame("NoType should be same", noType, erasure);
+ NullType nullType = _typeUtils.getNullType();
+ erasure = _typeUtils.erasure(nullType);
+ assertSame("NoType should be same", nullType, erasure);
+ }
private void createPackageBinary() throws IOException {
String path = packageName.replace('.', '/');
ClassLoader loader = getClass().getClassLoader();
diff --git a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java8ElementsTests.java b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java8ElementsTests.java
index f19a85c423..a2beb52682 100644
--- a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java8ElementsTests.java
+++ b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/Java8ElementsTests.java
@@ -369,6 +369,10 @@ public class Java8ElementsTests extends TestCase {
JavaCompiler compiler = BatchTestUtils.getEclipseCompiler();
internalTestWithBinary(compiler, JAVA8_ANNOTATION_PROC, "testEnumConstArguments", null, "bug521812");
}
+ public void testBug531717() throws Exception {
+ JavaCompiler compiler = BatchTestUtils.getEclipseCompiler();
+ internalTestWithBinary(compiler, JAVA8_ANNOTATION_PROC, "testBug531717", null, "bug521812");
+ }
private void internalTest(JavaCompiler compiler, String processor, String testMethod) throws IOException {
internalTest(compiler, processor, testMethod, null);
}

Back to the top