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 72603 Details for
Bug 139446
[build path] bug in the Edit Library dialog box, when changing the default JRE, and switching from alternate JRE to workspace default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fix with comment and more regression tests
139446.txt (text/plain), 4.82 KB, created by
Jerome Lanneluc
on 2007-06-27 10:25:41 EDT
(
hide
)
Description:
Fix with comment and more regression tests
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2007-06-27 10:25:41 EDT
Size:
4.82 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/ClasspathChange.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathChange.java,v >retrieving revision 1.6 >diff -u -r1.6 ClasspathChange.java >--- model/org/eclipse/jdt/internal/core/ClasspathChange.java 13 Apr 2007 16:02:15 -0000 1.6 >+++ model/org/eclipse/jdt/internal/core/ClasspathChange.java 27 Jun 2007 14:25:10 -0000 >@@ -227,6 +227,16 @@ > if (this.oldRawClasspath != null && !JavaProject.areClasspathsEqual(this.oldRawClasspath, newRawClasspath, this.oldOutputLocation, newOutputLocation)) { > delta.changed(this.project, IJavaElementDelta.F_CLASSPATH_CHANGED); > result |= HAS_DELTA; >+ >+ // reset containers that are no longer on the classpath >+ // (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=139446) >+ for (int i = 0, length = this.oldRawClasspath.length; i < length; i++) { >+ IClasspathEntry entry = this.oldRawClasspath[i]; >+ if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { >+ if (classpathContains(newRawClasspath, entry) == -1) >+ manager.containerPut(this.project, entry.getPath(), null); >+ } >+ } > } > > // if no changes to resolved classpath, nothing more to do >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java,v >retrieving revision 1.49 >diff -u -r1.49 ClasspathInitializerTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java 18 Apr 2007 13:08:18 -0000 1.49 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java 27 Jun 2007 14:25:15 -0000 >@@ -896,6 +896,70 @@ > } > } > >+/* >+ * Ensures that a container is not kept in the cache if no longer referenced on the classpath >+ * (regression test for 139446 [build path] bug in the Edit Library dialog box, when changing the default JRE, and switching from alternate JRE to workspace default) >+ */ >+public void testContainerInitializer19() throws CoreException { >+ try { >+ // setup >+ ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P1", "/P1/lib1.jar"})); >+ IJavaProject p1 = createJavaProject( >+ "P1", >+ new String[] {}, >+ new String[] {"org.eclipse.jdt.core.tests.model.TEST_CONTAINER"}, >+ ""); >+ createFile("/P1/lib1.jar", ""); >+ createFile("/P1/lib2.jar", ""); >+ p1.getResolvedClasspath(true); >+ IClasspathEntry[] initialClasspath = p1.getRawClasspath(); >+ >+ // remove reference to container, change initializer, and add reference to container back >+ p1.setRawClasspath(new IClasspathEntry[0], null); >+ ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P1", "/P1/lib2.jar"})); >+ p1.setRawClasspath(initialClasspath, null); >+ >+ assertClasspathEquals( >+ p1.getResolvedClasspath(true), >+ "/P1/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:false]" >+ ); >+ } finally { >+ deleteProject("P1"); >+ } >+} >+ >+/* >+ * Ensures that container a container is not kept in the cache if no longer referenced on the classpath >+ * (regression test for 136382 [classpath] Discard container if not referenced on classpath) >+ */ >+public void testContainerInitializer20() throws CoreException { >+ try { >+ IJavaProject p = createJavaProject("P"); >+ final StringBuffer paths = new StringBuffer(); >+ DefaultContainerInitializer initializer = new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"}) { >+ public void initialize(IPath containerPath, IJavaProject project) throws CoreException { >+ paths.append(containerPath); >+ paths.append('\n'); >+ super.initialize(containerPath, project); >+ } >+ }; >+ ContainerInitializer.setInitializer(initializer); >+ >+ setClasspath(p, new IClasspathEntry[] {JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER/JRE1"))}); >+ setClasspath(p, new IClasspathEntry[] {JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER/JRE2"))}); >+ setClasspath(p, new IClasspathEntry[] {JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER/JRE1"))}); >+ assertStringEquals( >+ "org.eclipse.jdt.core.tests.model.TEST_CONTAINER/JRE1\n" + >+ "org.eclipse.jdt.core.tests.model.TEST_CONTAINER/JRE2\n" + >+ "org.eclipse.jdt.core.tests.model.TEST_CONTAINER/JRE1\n", >+ paths.toString(), >+ false); >+ } finally { >+ stopDeltas(); >+ deleteProject("P"); >+ } >+} >+ > public void testVariableInitializer01() throws CoreException { > try { > createProject("P1");
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 139446
:
68574
| 72603