Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2020-02-12 06:37:37 +0000
committerTill Brychcy2020-02-13 07:11:25 +0000
commita457a5aee500850424330cb51a4d360b58b7a5b7 (patch)
tree143bdc2eadbd51c6a50a0273f08d15561111e687
parent5dbb6aab52273e0d8ae36705ace201c1c514583e (diff)
downloadeclipse.jdt.core-I20200213-1520.tar.gz
eclipse.jdt.core-I20200213-1520.tar.xz
eclipse.jdt.core-I20200213-1520.zip
Bug 559965 - No recompilation when deleting java file fromI20200214-0620I20200213-1800I20200213-1520I20200213-1210I20200213-1100
test-source-folder Change-Id: I854478623755e5f30a7ab32ff826c61c60b2e873
-rw-r--r--org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestAttributeBuilderTests.java35
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java3
2 files changed, 38 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestAttributeBuilderTests.java b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestAttributeBuilderTests.java
index b00aa4f6a9..140ddd944b 100644
--- a/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestAttributeBuilderTests.java
+++ b/org.eclipse.jdt.core.tests.builder/src/org/eclipse/jdt/core/tests/builder/TestAttributeBuilderTests.java
@@ -867,4 +867,39 @@ public class TestAttributeBuilderTests extends BuilderTests {
fullBuild();
expectingNoProblems();
}
+ public void testBug559965() throws JavaModelException {
+ // Bug 559965 - No recompilation when deleting java file from test-source-folder
+ IPath project1Path = env.addProject("Project1");
+ env.removePackageFragmentRoot(project1Path, "");
+ IPath src1 = env.addPackageFragmentRoot(project1Path, "src", null, "bin");
+ assertNotNull(src1);
+
+ IPath tests1 = env.addTestPackageFragmentRoot(project1Path, "tests");
+ env.addExternalJars(project1Path, Util.getJavaClassLibs());
+
+ env.addClass(tests1, "p1", "T1Class",
+ "package p1;\n" +
+ "\n" +
+ "public class T1Class {\n"+
+ "}\n"
+ );
+ env.addClass(tests1, "p1", "Test1",
+ "package p1;\n" +
+ "\n" +
+ "public class Test1 {\n" +
+ " void test1() {\n" +
+ " new T1Class();" +
+ " }\n" +
+ "}\n" +
+ ""
+ );
+
+ fullBuild();
+ expectingNoProblems();
+
+ env.removeClass(tests1, "p1/T1Class");
+ incrementalBuild();
+
+ expectingProblemsFor(env.getWorkspaceRootPath(), "Problem : T1Class cannot be resolved to a type [ resource : </Project1/tests/p1/Test1.java> range : <56,63> category : <40> severity : <2>]");
+ }
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java
index f4b786b704..eaaf803585 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IncrementalImageBuilder.java
@@ -137,6 +137,9 @@ public boolean build(SimpleLookupTable deltas) {
this.notifier.subTask(Messages.build_analyzingSources);
addAffectedSourceFiles();
+ if (this.testImageBuilder != null) {
+ this.testImageBuilder.addAffectedSourceFiles();
+ }
this.notifier.updateProgressDelta(0.05f);
}

Back to the top