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 189778 Details for
Bug 335986
No expected event fired when removing a JAR file from a classpath container
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug335986.txt (text/plain), 4.10 KB, created by
Jay Arthanareeswaran
on 2011-02-25 04:11:49 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2011-02-25 04:11:49 EST
Size:
4.10 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.25 >diff -u -r1.25 ClasspathChange.java >--- model/org/eclipse/jdt/internal/core/ClasspathChange.java 23 Jun 2009 05:40:04 -0000 1.25 >+++ model/org/eclipse/jdt/internal/core/ClasspathChange.java 25 Feb 2011 09:07:47 -0000 >@@ -28,6 +28,7 @@ > import org.eclipse.jdt.core.IPackageFragmentRoot; > import org.eclipse.jdt.core.JavaModelException; > import org.eclipse.jdt.internal.compiler.util.ObjectVector; >+import org.eclipse.jdt.internal.core.DeltaProcessor.RootInfo; > import org.eclipse.jdt.internal.core.JavaModelManager.PerProjectInfo; > import org.eclipse.jdt.internal.core.search.indexing.IndexManager; > import org.eclipse.jdt.internal.core.util.Util; >@@ -304,13 +305,22 @@ > result |= HAS_LIBRARY_CHANGE; > } > >- PackageFragmentRoot[] pkgFragmentRoots = null; >+ IPackageFragmentRoot[] pkgFragmentRoots = null; > if (removedRoots != null) { > PackageFragmentRoot oldRoot = (PackageFragmentRoot) removedRoots.get(this.oldResolvedClasspath[i].getPath()); > if (oldRoot != null) { // use old root if any (could be none if entry wasn't bound) > pkgFragmentRoots = new PackageFragmentRoot[] { oldRoot }; > } > } >+ else { >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=335986 >+ // When removedRoots doesn't have the package fragment roots, recover them from the cache >+ RootInfo rootInfo = (RootInfo)state.oldRoots.get(this.oldResolvedClasspath[i].getPath()); >+ if (rootInfo != null && rootInfo.cache != null) { >+ IPackageFragmentRoot oldRoot = rootInfo.cache; >+ pkgFragmentRoots = new IPackageFragmentRoot[] { oldRoot }; >+ } >+ } > if (pkgFragmentRoots == null) { > try { > ObjectVector accumulatedRoots = new ObjectVector(); >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.338.2.1 >diff -u -r1.338.2.1 DeltaProcessor.java >--- model/org/eclipse/jdt/internal/core/DeltaProcessor.java 13 Dec 2010 16:16:13 -0000 1.338.2.1 >+++ model/org/eclipse/jdt/internal/core/DeltaProcessor.java 25 Feb 2011 09:07:53 -0000 >@@ -102,6 +102,7 @@ > public JavaProject project; > IPath rootPath; > int entryKind; >+ IPackageFragmentRoot cache; > IPackageFragmentRoot root; > RootInfo(JavaProject project, IPath rootPath, char[][] inclusionPatterns, char[][] exclusionPatterns, int entryKind) { > this.project = project; >@@ -109,19 +110,24 @@ > this.inclusionPatterns = inclusionPatterns; > this.exclusionPatterns = exclusionPatterns; > this.entryKind = entryKind; >+ this.cache = getPackageFragmentRoot(); >+ } >+ private IPackageFragmentRoot getPackageFragmentRoot(){ >+ IPackageFragmentRoot tRoot = null; >+ Object target = JavaModel.getTarget(this.rootPath, false/*don't check existence*/); >+ if (target instanceof IResource) { >+ tRoot = this.project.getPackageFragmentRoot((IResource)target); >+ } else { >+ tRoot = this.project.getPackageFragmentRoot(this.rootPath.toOSString()); >+ } >+ return tRoot; > } > public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) { > if (this.root == null) { >- if (resource != null) { >- this.root = this.project.getPackageFragmentRoot(resource); >- } else { >- Object target = JavaModel.getTarget(this.rootPath, false/*don't check existence*/); >- if (target instanceof IResource) { >- this.root = this.project.getPackageFragmentRoot((IResource)target); >- } else { >- this.root = this.project.getPackageFragmentRoot(this.rootPath.toOSString()); >- } >+ if (resource == null) { >+ return this.cache; > } >+ this.root = this.project.getPackageFragmentRoot(resource); > } > return this.root; > }
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 335986
: 189778 |
190490
|
191378