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 168217 Details for
Bug 312678
ClasspathContainerVirtualComponent throws NPE on workspace restart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
My final patch for bug 311932
bug311932.patch (text/plain), 2.51 KB, created by
Carl Anderson
on 2010-05-12 14:05:26 EDT
(
hide
)
Description:
My final patch for bug 311932
Filename:
MIME Type:
Creator:
Carl Anderson
Created:
2010-05-12 14:05:26 EDT
Size:
2.51 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.common.frameworks >Index: src/org/eclipse/jst/common/internal/modulecore/ClasspathContainerVirtualComponent.java >=================================================================== >RCS file: /cvsroot/webtools/jeetools/plugins/org.eclipse.jst.common.frameworks/src/org/eclipse/jst/common/internal/modulecore/ClasspathContainerVirtualComponent.java,v >retrieving revision 1.3 >diff -u -r1.3 ClasspathContainerVirtualComponent.java >--- src/org/eclipse/jst/common/internal/modulecore/ClasspathContainerVirtualComponent.java 10 May 2010 17:44:46 -0000 1.3 >+++ src/org/eclipse/jst/common/internal/modulecore/ClasspathContainerVirtualComponent.java 12 May 2010 17:14:24 -0000 >@@ -43,12 +43,24 @@ > IVirtualComponent referencingComponent, String containerPath) { > super(p, referencingComponent); > this.containerPath = containerPath; >+ loadContainerEntries(); >+ } >+ >+ private void loadContainerEntries() { > try { >- container = JavaCore.getClasspathContainer(new Path(containerPath), JavaCore.create(p)); >- containerEntries = container.getClasspathEntries(); >- } catch( JavaModelException jme ) { >- >- } >+ if( container == null ) { >+ IClasspathContainer container2 = >+ JavaCore.getClasspathContainer(new Path(containerPath), >+ JavaCore.create(getProject())); >+ container = container2; >+ containerEntries = null; >+ } >+ if( container != null && containerEntries == null ) { >+ containerEntries = container.getClasspathEntries(); >+ } >+ } catch( JavaModelException jme ) { >+ containerEntries = null; >+ } > } > > @Override >@@ -98,10 +110,14 @@ > @Override > public IVirtualResource[] members(int memberFlags) throws CoreException { > ArrayList<IVirtualFile> jars = new ArrayList<IVirtualFile>(); >- for( int i = 0; i < containerEntries.length; i++ ) { >- if( containerEntries[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) { >- File f = containerEntries[i].getPath().toFile(); >- jars.add(new AbsoluteVirtualFile(getProject(), new Path("/"), f)); //$NON-NLS-1$ >+ loadContainerEntries(); >+ if (containerEntries != null) >+ { >+ for( int i = 0; i < containerEntries.length; i++ ) { >+ if( containerEntries[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) { >+ File f = containerEntries[i].getPath().toFile(); >+ jars.add(new AbsoluteVirtualFile(getProject(), new Path("/"), f)); //$NON-NLS-1$ >+ } > } > } > return jars.toArray(new IVirtualFile[jars.size()]);
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 312678
: 168217