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 111479 Details for
Bug 216446
[buildpath] Missing classpath 'variable' jars aren't seen when supplied
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression test
216446.txt (text/plain), 5.65 KB, created by
Jerome Lanneluc
on 2008-09-02 10:50:21 EDT
(
hide
)
Description:
Proposed fix and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2008-09-02 10:50:21 EDT
Size:
5.65 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/JavaModelManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java,v >retrieving revision 1.408 >diff -u -r1.408 JavaModelManager.java >--- model/org/eclipse/jdt/internal/core/JavaModelManager.java 1 Sep 2008 08:53:56 -0000 1.408 >+++ model/org/eclipse/jdt/internal/core/JavaModelManager.java 2 Sep 2008 14:49:48 -0000 >@@ -1069,6 +1069,8 @@ > if (target instanceof File) { > long timestamp = DeltaProcessor.getTimeStamp((java.io.File)target); > externalTimeStamps.put(path, new Long(timestamp)); >+ } else { >+ externalTimeStamps.put(path, DeltaProcessingState.MISSING_JAR); > } > } > } >Index: model/org/eclipse/jdt/internal/core/DeltaProcessor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java,v >retrieving revision 1.326 >diff -u -r1.326 DeltaProcessor.java >--- model/org/eclipse/jdt/internal/core/DeltaProcessor.java 27 Aug 2008 08:59:19 -0000 1.326 >+++ model/org/eclipse/jdt/internal/core/DeltaProcessor.java 2 Sep 2008 14:49:47 -0000 >@@ -864,7 +864,8 @@ > Object targetLibrary = JavaModel.getTarget(entryPath, true); > > if (targetLibrary == null){ // missing JAR >- if (this.state.getExternalLibTimeStamps().remove(entryPath) != null /* file was known*/ >+ Long oldTimestamp = (Long) this.state.getExternalLibTimeStamps().put(entryPath, DeltaProcessingState.MISSING_JAR); >+ if (oldTimestamp != null && oldTimestamp != DeltaProcessingState.MISSING_JAR/* file was known*/ > && this.state.roots.get(entryPath) != null /* and it was on the classpath*/) { > externalArchivesStatus.put(entryPath, EXTERNAL_JAR_REMOVED); > // the jar was physically removed: remove the index >@@ -878,11 +879,11 @@ > // check timestamp to figure if JAR has changed in some way > Long oldTimestamp =(Long) this.state.getExternalLibTimeStamps().get(entryPath); > long newTimeStamp = getTimeStamp(externalFile); >- if (oldTimestamp != null){ >+ if (oldTimestamp != null && oldTimestamp != DeltaProcessingState.MISSING_JAR) { > > if (newTimeStamp == 0){ // file doesn't exist > externalArchivesStatus.put(entryPath, EXTERNAL_JAR_REMOVED); >- this.state.getExternalLibTimeStamps().remove(entryPath); >+ this.state.getExternalLibTimeStamps().put(entryPath, DeltaProcessingState.MISSING_JAR); > // remove the index > this.manager.indexManager.removeIndex(entryPath); > >Index: model/org/eclipse/jdt/internal/core/DeltaProcessingState.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessingState.java,v >retrieving revision 1.50 >diff -u -r1.50 DeltaProcessingState.java >--- model/org/eclipse/jdt/internal/core/DeltaProcessingState.java 27 Jun 2008 16:03:51 -0000 1.50 >+++ model/org/eclipse/jdt/internal/core/DeltaProcessingState.java 2 Sep 2008 14:49:47 -0000 >@@ -30,6 +30,8 @@ > * Keep the global states used during Java element delta processing. > */ > public class DeltaProcessingState implements IResourceChangeListener { >+ >+ public static final Long MISSING_JAR = new Long(-1); > > /* > * Collection of listeners for Java element deltas >@@ -449,7 +451,7 @@ > while (size-- > 0) { > String key = in.readUTF(); > long timestamp = in.readLong(); >- timeStamps.put(Path.fromPortableString(key), new Long(timestamp)); >+ timeStamps.put(Path.fromPortableString(key), timestamp == -1 ? MISSING_JAR : new Long(timestamp)); > } > } catch (IOException e) { > if (timestampsFile.exists()) >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClasspathTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java,v >retrieving revision 1.182 >diff -u -r1.182 ClasspathTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 1 Sep 2008 14:46:52 -0000 1.182 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 2 Sep 2008 14:49:50 -0000 >@@ -2687,7 +2687,7 @@ > * Ensures that a marker is removed if adding an internal jar that is on the classpath in another project > * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=213723 ) > */ >-public void testFixClasspath() throws CoreException { >+public void testFixClasspath1() throws CoreException { > try { > createProject("P1"); > IJavaProject project = createJavaProject("P2", new String[0], new String[] {"/P1/lib.jar"}, "bin"); >@@ -2703,6 +2703,25 @@ > deleteProject("P2"); > } > } >+/* >+ * Ensures that a marker is removed if adding an external jar, restarting and refreshing >+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=216446 ) >+ */ >+public void testFixClasspath2() throws CoreException { >+ try { >+ IJavaProject p = createJavaProject("P", new String[0], new String[] {getExternalResourcePath("externalLib.abc")}, ""); >+ waitForAutoBuild(); // 1 marker >+ createExternalFile("externalLib.abc", ""); >+ >+ simulateExitRestart(); >+ refreshExternalArchives(p); >+ >+ assertMarkers("Unexpected markers", "", p); >+ } finally { >+ deleteExternalResource("externalLib.abc"); >+ deleteProject("P"); >+ } >+} > /** > * Test IJavaProject.hasClasspathCycle(IClasspathEntry[]). > */
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 216446
:
111479
|
111799