67324
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/InclusionPatternsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/InclusionPatternsTests.java
index 045f9a5..c91c3b0 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/InclusionPatternsTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/InclusionPatternsTests.java
@@ -427,6 +427,44 @@
assertTrue("Resource should be on classpath", project.isOnClasspath(file));
}
/*
+ * Ensures that moving a folder that contains an included package reports the correct delta.
+ * (regression test for bug 67324 Package Explorer doesn't update included package after moving contents of source folder)
+ */
+public void testMoveFolderContainingPackage1() throws CoreException {
+ setClasspath(new String[] {"/P/src", "p1/p2/"});
+ createFolder("/P/src/p1/p2");
+
+ clearDeltas();
+ getFolder("/P/src/p1").move(new Path("/P/p1"), false, null);
+ assertDeltas(
+ "Unexpected deltas",
+ "P[*]: {CHILDREN | CONTENT}\n" +
+ " src[*]: {CHILDREN | CONTENT}\n" +
+ " p1.p2[-]: {}\n" +
+ " ResourceDelta(/P/src/p1)[-]\n" +
+ " ResourceDelta(/P/p1)[+]"
+ );
+}
+/*
+ * Ensures that moving a folder that contains an included package reports the correct delta.
+ * (regression test for bug 67324 Package Explorer doesn't update included package after moving contents of source folder)
+ */
+public void testMoveFolderContainingPackage2() throws CoreException {
+ setClasspath(new String[] {"/P/src", "p1/p2/"});
+ createFolder("/P/p1/p2");
+
+ clearDeltas();
+ getFolder("/P//p1").move(new Path("/P/src/p1"), false, null);
+ assertDeltas(
+ "Unexpected deltas",
+ "P[*]: {CHILDREN | CONTENT}\n" +
+ " src[*]: {CHILDREN | CONTENT}\n" +
+ " p1.p2[+]: {}\n" +
+ " ResourceDelta(/P/src/p1)[+]\n" +
+ " ResourceDelta(/P/p1)[-]"
+ );
+}
+/*
* Ensures that a non-included nested source folder doesn't appear as a non-java resource of the outer folder.
*
*/
diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html
index 23b6c0e..16aa39b 100644
--- a/org.eclipse.jdt.core/buildnotes_jdt-core.html
+++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html
@@ -46,7 +46,9 @@
</ul>
<h3>Problem Reports Fixed</h3>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=41434">41434</a>
+<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=67324">67324</a>
+Package Explorer doesn't update included package after moving contents of source folder
+<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=41434">41434</a>
[msic] Slow Down using classes with many methods
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=64646">64646</a>
[Navigator] Navigator popup causes Eclipse to hang.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
index f022545..6d22858 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
@@ -2268,7 +2268,7 @@
if (element == null) {
// resource might be containing shared roots (see bug 19058)
this.state.updateRoots(deltaRes.getFullPath(), delta, this);
- return false;
+ return rootInfo != null && rootInfo.inclusionPatterns != null;
}
updateIndex(element, delta);
elementAdded(element, delta, rootInfo);
@@ -2279,7 +2279,7 @@
if (element == null) {
// resource might be containing shared roots (see bug 19058)
this.state.updateRoots(deltaRes.getFullPath(), delta, this);
- return false;
+ return rootInfo != null && rootInfo.inclusionPatterns != null;
}
updateIndex(element, delta);
elementRemoved(element, delta, rootInfo);