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 85109 Details for
Bug 212769
SetClasspathOperation no longer adds project for refresh
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression test
212769.txt (text/plain), 5.48 KB, created by
Jerome Lanneluc
on 2007-12-12 14:07:22 EST
(
hide
)
Description:
Proposed fix and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2007-12-12 14:07:22 EST
Size:
5.48 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.309 >diff -u -r1.309 DeltaProcessor.java >--- model/org/eclipse/jdt/internal/core/DeltaProcessor.java 29 Nov 2007 14:10:09 -0000 1.309 >+++ model/org/eclipse/jdt/internal/core/DeltaProcessor.java 12 Dec 2007 19:03:44 -0000 >@@ -1849,6 +1849,12 @@ > this.currentDelta = null; > } > >+ // add late coming elements to refresh (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=212769 ) >+ if (elementsToRefresh == null) >+ elementsToRefresh = this.state.removeExternalElementsToRefresh(); >+ else >+ elementsToRefresh.addAll(this.state.removeExternalElementsToRefresh()); >+ > // generate external archive change deltas > if (elementsToRefresh != null) { > createExternalArchiveDelta(elementsToRefresh, null); >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.9 >diff -u -r1.9 ClasspathChange.java >--- model/org/eclipse/jdt/internal/core/ClasspathChange.java 29 Nov 2007 12:59:06 -0000 1.9 >+++ model/org/eclipse/jdt/internal/core/ClasspathChange.java 12 Dec 2007 19:03:43 -0000 >@@ -10,12 +10,16 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.core; > >+import java.io.File; >+import java.net.URI; > import java.util.ArrayList; > import java.util.HashMap; > import java.util.HashSet; > import java.util.Iterator; > import java.util.Map; > >+import org.eclipse.core.filesystem.EFS; >+import org.eclipse.core.filesystem.IFileStore; > import org.eclipse.core.resources.IFolder; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.IWorkspace; >@@ -261,6 +265,8 @@ > > delta.changed(this.project, IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED); > result |= HAS_DELTA; >+ >+ state.addForRefresh(this.project); // ensure external jars are refreshed for this project (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=212769 ) > > Map removedRoots = null; > IPackageFragmentRoot[] roots = null; >@@ -314,6 +320,26 @@ > } > } > addClasspathDeltas(delta, pkgFragmentRoots, IJavaElementDelta.F_REMOVED_FROM_CLASSPATH); >+ >+ // remember timestamp of jars that were removed (in case they are added as external jar in the same operation) >+ for (int j = 0, length = pkgFragmentRoots.length; j < length; j++) { >+ IPackageFragmentRoot root = pkgFragmentRoots[j]; >+ if (root.isArchive() && !root.isExternal()) { >+ URI location = root.getResource().getLocationURI(); >+ File file = null; >+ try { >+ IFileStore fileStore = EFS.getStore(location); >+ file = fileStore.toLocalFile(EFS.NONE, null); >+ } catch (CoreException e) { >+ // continue >+ } >+ if (file == null) >+ continue; >+ long timeStamp = DeltaProcessor.getTimeStamp(file); >+ IPath externalPath = new org.eclipse.core.runtime.Path(file.getAbsolutePath()); >+ state.getExternalLibTimeStamps().put(externalPath, new Long(timeStamp)); >+ } >+ } > } else { > // remote project changes > if (this.oldResolvedClasspath[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) { >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ExternalJarDeltaTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExternalJarDeltaTests.java,v >retrieving revision 1.31 >diff -u -r1.31 ExternalJarDeltaTests.java >--- src/org/eclipse/jdt/core/tests/model/ExternalJarDeltaTests.java 25 Sep 2007 15:33:38 -0000 1.31 >+++ src/org/eclipse/jdt/core/tests/model/ExternalJarDeltaTests.java 12 Dec 2007 19:03:45 -0000 >@@ -270,6 +270,41 @@ > this.stopDeltas(); > } > } >+/* >+ * Ensures that the correct delta is reported after a setRawClasspath and after a modification of an external jar. >+ */ >+public void testExternalJarChanged6() throws CoreException, IOException { >+ File f = null; >+ try { >+ IJavaProject project = this.createJavaProject("P", new String[] {""}, ""); >+ >+ String pPath = getExternalPath() + "p.jar"; >+ setClasspath(project, new IClasspathEntry[]{JavaCore.newLibraryEntry(new Path(pPath), null, null)}); >+ >+ f = new File(pPath); >+ f.createNewFile(); >+ getJavaModel().refreshExternalArchives(null,null); >+ waitUntilIndexesReady(); >+ startDeltas(); >+ >+ touch(f); >+ setClasspath(project, new IClasspathEntry[]{JavaCore.newLibraryEntry(new Path(pPath), null, null), JavaCore.newSourceEntry(new Path("/P"))}); >+ >+ assertDeltas( >+ "Unexpected delta", >+ "P[*]: {CHILDREN | CONTENT | RAW CLASSPATH CHANGED | RESOLVED CLASSPATH CHANGED}\n" + >+ " <project root>[*]: {ADDED TO CLASSPATH}\n" + >+ " D:\\eclipse\\workspace\\p.jar[*]: {CONTENT | ARCHIVE CONTENT CHANGED}\n" + >+ " ResourceDelta(/P/.classpath)[*]" >+ ); >+ } finally { >+ if(f != null) { >+ deleteFile(f); >+ } >+ this.deleteProject("P"); >+ this.stopDeltas(); >+ } >+} > /** > * Refresh the JavaModel after an addition of an external jar. > */
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 212769
:
85109
|
85276
|
85292