Lines 12-17
Link Here
|
12 |
|
12 |
|
13 |
import java.io.IOException; |
13 |
import java.io.IOException; |
14 |
|
14 |
|
|
|
15 |
import org.eclipse.core.resources.IFolder; |
15 |
import org.eclipse.core.runtime.CoreException; |
16 |
import org.eclipse.core.runtime.CoreException; |
16 |
import org.eclipse.core.runtime.IPath; |
17 |
import org.eclipse.core.runtime.IPath; |
17 |
import org.eclipse.core.runtime.IProgressMonitor; |
18 |
import org.eclipse.core.runtime.IProgressMonitor; |
Lines 451-456
Link Here
|
451 |
} |
452 |
} |
452 |
|
453 |
|
453 |
/* |
454 |
/* |
|
|
455 |
* Ensures that if a root folder (that has a jar like name) is opened, and then a Jar package fragment root created on this root folder, |
456 |
* then attempting to open a class file in this folder doesn't throw a ClassCastException |
457 |
* (regression test for bug 204652 "Open Type": ClassCastException in conjunction with a class folder) |
458 |
*/ |
459 |
public void testJarLikeRootFolder() throws CoreException { |
460 |
try { |
461 |
IJavaProject p = createJavaProject("P1", new String[0], new String[] {"/P1/classFolder.jar"}, ""); |
462 |
IFolder folder = createFolder("/P1/classFolder.jar/p"); |
463 |
createFile("/P1/classFolder.jar/X.class", "p"); |
464 |
|
465 |
// populate cache with a valid package fragment root and a valid package fragment |
466 |
IPackageFragment validPkg = p.getPackageFragmentRoot(folder.getParent()).getPackageFragment("p"); |
467 |
validPkg.open(null); |
468 |
|
469 |
// create an invalid package fragment root and an invalid package fragment |
470 |
IPackageFragment invalidPkg = p.getPackageFragmentRoot("/P1/classFolder.jar").getPackageFragment("p"); |
471 |
|
472 |
// ensure that the class fille cannot be opened with a valid excepption |
473 |
IClassFile openable = invalidPkg.getClassFile("X.class"); |
474 |
JavaModelException expected = null; |
475 |
try { |
476 |
openable.open(null); |
477 |
} catch (JavaModelException e) { |
478 |
expected = e; |
479 |
} |
480 |
assertExceptionEquals("Unexpected exception", "classFolder.jar [in P1] does not exist", expected); |
481 |
} finally { |
482 |
deleteProject("P1"); |
483 |
} |
484 |
} |
485 |
|
486 |
/* |
454 |
* Ensures that the parameter names of a binary method with source attached are correct. |
487 |
* Ensures that the parameter names of a binary method with source attached are correct. |
455 |
*/ |
488 |
*/ |
456 |
public void testParameterNames01() throws CoreException { |
489 |
public void testParameterNames01() throws CoreException { |