diff options
author | Sergey Prigogin | 2015-06-01 17:53:34 +0000 |
---|---|---|
committer | Markus Keller | 2015-06-01 17:55:18 +0000 |
commit | 7a6bf774efceb93e4277a70cc59614d5d931a27e (patch) | |
tree | 4bb5b41175e356aaa2d9554b0e27211f43e73f51 /org.eclipse.jdt.apt.pluggable.tests | |
parent | d447d64200493d4e1d6a7b99f9c357ac6aadcf48 (diff) | |
download | eclipse.jdt.core-7a6bf774efceb93e4277a70cc59614d5d931a27e.tar.gz eclipse.jdt.core-7a6bf774efceb93e4277a70cc59614d5d931a27e.tar.xz eclipse.jdt.core-7a6bf774efceb93e4277a70cc59614d5d931a27e.zip |
Bug 468853 - NPE in Compiler.restoreAptProblemsI20150601-2000
Change-Id: Ifbf09f528297221162b1b9cf281157669f3741ae
Signed-off-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Also-by: Markus Keller <markus_keller@ch.ibm.com>
Diffstat (limited to 'org.eclipse.jdt.apt.pluggable.tests')
-rw-r--r-- | org.eclipse.jdt.apt.pluggable.tests/src/org/eclipse/jdt/apt/pluggable/tests/BuilderTests.java | 50 |
1 files changed, 47 insertions, 3 deletions
diff --git a/org.eclipse.jdt.apt.pluggable.tests/src/org/eclipse/jdt/apt/pluggable/tests/BuilderTests.java b/org.eclipse.jdt.apt.pluggable.tests/src/org/eclipse/jdt/apt/pluggable/tests/BuilderTests.java index 9610a4d5d2..e9d19ad5f4 100644 --- a/org.eclipse.jdt.apt.pluggable.tests/src/org/eclipse/jdt/apt/pluggable/tests/BuilderTests.java +++ b/org.eclipse.jdt.apt.pluggable.tests/src/org/eclipse/jdt/apt/pluggable/tests/BuilderTests.java @@ -15,9 +15,6 @@ package org.eclipse.jdt.apt.pluggable.tests; import java.util.List; -import junit.framework.Test; -import junit.framework.TestSuite; - import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IPath; import org.eclipse.jdt.apt.core.util.AptConfig; @@ -28,6 +25,9 @@ import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.tests.builder.Problem; import org.eclipse.jdt.internal.core.builder.AbstractImageBuilder; +import junit.framework.Test; +import junit.framework.TestSuite; + /** * Tests covering the IDE's ability to process the correct set of files. */ @@ -294,4 +294,48 @@ public class BuilderTests extends TestBase } } + + public void testBug468853() throws Throwable { + int old = AbstractImageBuilder.MAX_AT_ONCE; + IJavaProject jproj = createJavaProject(_projectName); + disableJava5Factories(jproj); + IProject proj = jproj.getProject(); + IPath projPath = proj.getFullPath(); + IPath root = projPath.append("src"); + IPath packagePath = root.append("test"); + try { + // Force the build to be batched + AbstractImageBuilder.MAX_AT_ONCE = 2; + ProcessorTestStatus.reset(); + + env.addClass(root, "test", "Foo", + "package test;\n" + + "import org.eclipse.jdt.apt.pluggable.tests.annotations.GenClass6;\n" + + "import org.eclipse.jdt.apt.pluggable.tests.annotations.Message6;\n" + + "import javax.tools.Diagnostic.Kind;\n" + + "@GenClass6(name = \"FooGen\", pkg = \"test\", rounds = 2)\n" + + "@Message6(text = \"APT message\", value = Kind.ERROR)\n" + + "public class Foo extends FooGen {\n" + + " public Bar bar;\n" + + "}"); + env.addClass(root, "test", "Bar", + "package test;\n" + + "public class Bar {\n" + + " public Foo foo;\n" + + "}"); + AptConfig.setEnabled(jproj, true); + + fullBuild(); + expectingNoProblems(); + expectingUniqueCompiledClasses( + new String[] {"test.Foo", "test.Bar", "test.FooGen", "test.FooGenGen"}); + + } finally { + AbstractImageBuilder.MAX_AT_ONCE = old; + env.removeClass(packagePath, "Foo"); + env.removeClass(packagePath, "Bar"); + env.removeClass(packagePath, "FooGen"); + + } + } } |