Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 40303 Details for
Bug 138577
Package content disapear in package explorer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch and regression test
138577.txt (text/plain), 3.08 KB, created by
Jerome Lanneluc
on 2006-05-03 17:02:13 EDT
(
hide
)
Description:
Proposed patch and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2006-05-03 17:02:13 EDT
Size:
3.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java,v >retrieving revision 1.66 >diff -u -r1.66 JavaProjectTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java 29 Mar 2006 04:03:07 -0000 1.66 >+++ src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java 3 May 2006 20:59:08 -0000 >@@ -620,6 +620,44 @@ > assertTrue("java should have subpackages", java.hasSubpackages()); > assertTrue("java.lang should NOT have subpackages", !lang.hasSubpackages()); > } >+/* >+ * Ensures that the structure is known for a package fragment on the classpath. >+ */ >+public void testPackageFragmentIsStructureKnown1() throws CoreException { >+ IPackageFragment pkg = getPackageFragment("JavaProjectTests", "", "x"); >+ assertTrue("Structure of package 'x' should be known", pkg.isStructureKnown()); >+} >+/* >+ * Ensures that asking if the structure is known for a package fragment outside the classpath throws a JavaModelException. >+ * (regression test for bug 138577 Package content disapear in package explorer) >+ */ >+public void testPackageFragmentIsStructureKnown2() throws CoreException { >+ try { >+ createJavaProject("P"); >+ createFolder("/P/pack"); >+ IPackageFragment pkg = getPackage("/P/pack"); >+ editFile( >+ "/P/.classpath", >+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >+ "<classpath>\n" + >+ " <classpathentry excluding=\"pack/\" kind=\"src\" path=\"\"/>\n" + >+ " <classpathentry kind=\"output\" path=\"\"/>\n" + >+ "</classpath>" >+ ); >+ JavaModelException exception = null; >+ try { >+ pkg.isStructureKnown(); >+ } catch (JavaModelException e) { >+ exception = e; >+ } >+ assertExceptionEquals( >+ "Unexpected exception", >+ "pack [in <project root> [in P]] does not exist", >+ exception); >+ } finally { >+ deleteProject("P"); >+ } >+} > /** > * Test getting the non-java resources from a package fragment. > */ >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/PackageFragment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java,v >retrieving revision 1.77 >diff -u -r1.77 PackageFragment.java >--- model/org/eclipse/jdt/internal/core/PackageFragment.java 29 Mar 2006 03:08:47 -0000 1.77 >+++ model/org/eclipse/jdt/internal/core/PackageFragment.java 3 May 2006 20:59:14 -0000 >@@ -65,8 +65,12 @@ > > // check whether this pkg can be opened > if (!underlyingResource.isAccessible()) throw newNotPresentException(); >- >+ >+ // check that it is not excluded (https://bugs.eclipse.org/bugs/show_bug.cgi?id=138577) > int kind = getKind(); >+ if (kind == IPackageFragmentRoot.K_SOURCE && Util.isExcluded(this)) >+ throw newNotPresentException(); >+ > > // add compilation units/class files from resources > HashSet vChildren = new HashSet();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 138577
:
40303
|
40326
|
40335