View | Details | Raw Unified | Return to bug 362711 | Differences between
and this patch

Collapse All | Expand All

(-)a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElementDeltaTests.java (-1 / +29 lines)
Lines 34-40 Link Here
34
// All specified tests which do not belong to the class are skipped...
34
// All specified tests which do not belong to the class are skipped...
35
static {
35
static {
36
//	TESTS_PREFIX =  "testBug100772_ProjectScope";
36
//	TESTS_PREFIX =  "testBug100772_ProjectScope";
37
//	TESTS_NAMES = new String[] { "testAddInvalidSubfolder" };
37
//	TESTS_NAMES = new String[] { "testBug362711" };
38
//	TESTS_NUMBERS = new int[] { 100772 };
38
//	TESTS_NUMBERS = new int[] { 100772 };
39
//	TESTS_RANGE = new int[] { 83304, -1 };
39
//	TESTS_RANGE = new int[] { 83304, -1 };
40
}
40
}
Lines 3053-3057 Link Here
3053
		deleteProject("P");
3053
		deleteProject("P");
3054
	}
3054
	}
3055
}
3055
}
3056
/**
3057
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=362711"
3058
 */
3059
public void testBug362711() throws Exception {
3060
	try {
3061
		createJavaProject("P", new String[] { "src" }, "bin");
3062
		createJavaProject("Q", new String[] { "src" }, "bin");
3063
3064
		createFile("/P/src/Foo.java", "public class Foo {\n"
3065
				+ "private int id;\n" + "}");
3066
		createFile("/Q/src/Foo.java", "public class Foo {\n" + "}");
3067
3068
		startDeltas();
3069
		ICompilationUnit cu = getCompilationUnit("P/src/Foo.java"); 
3070
		IPackageFragment dest = getPackageFragment("Q", "src", "");
3071
		cu.copy(dest, null, null, true, null);
3072
		assertDeltas("Unexpected delta", 
3073
						"Q[*]: {CHILDREN}\n" + 
3074
						"	src[*]: {CHILDREN}\n" + 
3075
						"		<default>[*]: {CHILDREN}\n" + 
3076
						"			Foo.java[*]: {CONTENT | PRIMARY RESOURCE}");
3077
		
3078
	} finally {
3079
		stopDeltas();
3080
		deleteProject("P");
3081
		deleteProject("Q");
3082
	}
3083
}
3056
}
3084
}
3057
3085
(-)a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java (+1 lines)
Lines 317-322 Link Here
317
						if (this.force) {
317
						if (this.force) {
318
							// we can remove it
318
							// we can remove it
319
							deleteResource(destFile, IResource.KEEP_HISTORY);
319
							deleteResource(destFile, IResource.KEEP_HISTORY);
320
							getDeltaFor(dest.getJavaProject()).removed(destCU);
320
							destCU.close(); // ensure the in-memory buffer for the dest CU is closed
321
							destCU.close(); // ensure the in-memory buffer for the dest CU is closed
321
						} else {
322
						} else {
322
							// abort
323
							// abort

Return to bug 362711