View | Details | Raw Unified | Return to bug 256404
Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java (-1 / +1 lines)
Lines 454-460 Link Here
454
 */
454
 */
455
protected void getHandleMemento(StringBuffer buff) {
455
protected void getHandleMemento(StringBuffer buff) {
456
	IPath path;
456
	IPath path;
457
	IResource underlyingResource = resource();
457
	IResource underlyingResource = getResource();
458
	if (underlyingResource != null) {
458
	if (underlyingResource != null) {
459
		// internal jar or regular root
459
		// internal jar or regular root
460
		if (resource().getProject().equals(getJavaProject().getProject())) {
460
		if (resource().getProject().equals(getJavaProject().getProject())) {
(-)src/org/eclipse/jdt/core/tests/model/MementoTests.java (-2 / +21 lines)
Lines 13-20 Link Here
13
import java.io.File;
13
import java.io.File;
14
14
15
import org.eclipse.core.resources.*;
15
import org.eclipse.core.resources.*;
16
import org.eclipse.core.resources.IFolder;
17
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.Path;
18
import org.eclipse.jdt.core.*;
18
import org.eclipse.jdt.core.*;
19
import org.eclipse.jdt.core.tests.util.Util;
19
import org.eclipse.jdt.core.tests.util.Util;
20
import org.eclipse.jdt.internal.core.JavaElement;
20
import org.eclipse.jdt.internal.core.JavaElement;
Lines 65-71 Link Here
65
		restored);
65
		restored);
66
}
66
}
67
protected String getEscapedExternalJCLPath() {
67
protected String getEscapedExternalJCLPath() {
68
	String path = getExternalJCLPath().toString();
68
	return getEscapedPath(getExternalJCLPath().toString());
69
}
70
protected String getEscapedPath(String path) {
69
	StringBuffer buffer = new StringBuffer();
71
	StringBuffer buffer = new StringBuffer();
70
	for (int i = 0; i < path.length(); i++) {
72
	for (int i = 0; i < path.length(); i++) {
71
		char character = path.charAt(i);
73
		char character = path.charAt(i);
Lines 77-82 Link Here
77
public void setUpSuite() throws Exception {
79
public void setUpSuite() throws Exception {
78
	super.setUpSuite();
80
	super.setUpSuite();
79
81
82
	Util.createClassFolder(new String[] {
83
		"X.java",
84
		"public class X {}"
85
		}, 
86
		getExternalResourcePath("myLib"), 
87
		"1.4");
80
	this.createJavaProject(
88
	this.createJavaProject(
81
			"P",
89
			"P",
82
			new String[] {"src"},
90
			new String[] {"src"},
Lines 86-96 Link Here
86
				"/P/lib/myLib.jar",
94
				"/P/lib/myLib.jar",
87
				"/OtherProj/lib",
95
				"/OtherProj/lib",
88
				"/OtherProj/lib/myLib.jar",
96
				"/OtherProj/lib/myLib.jar",
97
				getExternalResourcePath("myLib")
89
			},
98
			},
90
			"bin");
99
			"bin");
91
}
100
}
92
public void tearDownSuite() throws Exception {
101
public void tearDownSuite() throws Exception {
93
	this.deleteProject("P");
102
	this.deleteProject("P");
103
	deleteExternalResource("myLib");
94
	super.tearDownSuite();
104
	super.tearDownSuite();
95
}
105
}
96
/*
106
/*
Lines 338-343 Link Here
338
		"=P/" + device + "\\/lib.jar<p(X.class",
348
		"=P/" + device + "\\/lib.jar<p(X.class",
339
		classFile);
349
		classFile);
340
}
350
}
351
/*
352
 * Ensures that a class file in an external library folder can be persisted and restored using its memento.
353
 */
354
public void testExternalLibraryFolderClassFileMemento() throws JavaModelException {
355
	IClassFile classFile = getClassFile("P", getExternalResourcePath("myLib"), "", "X.class");
356
	assertMemento(
357
		"=P/" + getEscapedPath(new Path(getExternalResourcePath("myLib")).toString()) + "<(X.class",
358
		classFile);
359
}
341
/**
360
/**
342
 * Tests that an import declaration can be persisted and restored using its memento.
361
 * Tests that an import declaration can be persisted and restored using its memento.
343
 */
362
 */

Return to bug 256404