Lines 6641-6645
Link Here
|
6641 |
this.deleteProject("P"); |
6641 |
this.deleteProject("P"); |
6642 |
} |
6642 |
} |
6643 |
} |
6643 |
} |
|
|
6644 |
/** |
6645 |
* @bug 308150: JAR with invalid Class-Path entry in MANIFEST.MF crashes the project |
6646 |
* Test that an invalid referenced library entry in the Class-Path of the MANIFEST doesn't |
6647 |
* create any exceptions and is NOT added to the resolved classpath. |
6648 |
* |
6649 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=308150" |
6650 |
* @throws Exception |
6651 |
*/ |
6652 |
public void testBug308150() throws Exception { |
6653 |
try { |
6654 |
|
6655 |
IJavaProject proj = this.createJavaProject("P", new String[] {}, "bin"); |
6656 |
IClasspathEntry[] classpath = new IClasspathEntry[2]; |
6657 |
|
6658 |
// The Class-Path references an entry that points to the workspace root (hence invalid) |
6659 |
addLibrary(proj, "invalid.jar", null, new String[0], |
6660 |
new String[] { |
6661 |
"META-INF/MANIFEST.MF", |
6662 |
"Manifest-Version: 1.0\n" + |
6663 |
"Class-Path: ../..\n", |
6664 |
}, |
6665 |
JavaCore.VERSION_1_4); |
6666 |
|
6667 |
addExternalLibrary(proj, getExternalResourcePath("invalid2.jar"), new String[0], |
6668 |
new String[] { |
6669 |
"META-INF/MANIFEST.MF", |
6670 |
"Manifest-Version: 1.0\n" + |
6671 |
"Class-Path: ../..\n", |
6672 |
}, |
6673 |
JavaCore.VERSION_1_4); |
6674 |
refreshExternalArchives(proj); |
6675 |
|
6676 |
classpath[0] = JavaCore.newLibraryEntry(new Path("/P/invalid.jar"), null, null); |
6677 |
classpath[1] = JavaCore.newLibraryEntry(new Path(getExternalResourcePath("invalid2.jar")), null, null); |
6678 |
proj.setRawClasspath(classpath, null); |
6679 |
waitForAutoBuild(); |
6680 |
IClasspathEntry[] resolvedClasspath = proj.getResolvedClasspath(true); |
6681 |
|
6682 |
assertClasspathEquals(resolvedClasspath, |
6683 |
"/P/invalid.jar[CPE_LIBRARY][K_BINARY][isExported:false]\n" + |
6684 |
""+ getExternalPath() + "invalid2.jar[CPE_LIBRARY][K_BINARY][isExported:false]"); |
6685 |
} finally { |
6686 |
this.deleteProject("P"); |
6687 |
} |
6688 |
} |
6644 |
|
6689 |
|
6645 |
} |
6690 |
} |