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 151515 Details for
Bug 294211
Classes from an unresolved fragment used by the host
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]
PDE + framework patch
294211.patch (text/plain), 4.08 KB, created by
Thomas Watson
on 2009-11-05 18:16:44 EST
(
hide
)
Description:
PDE + framework patch
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2009-11-05 18:16:44 EST
Size:
4.08 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.osgi >Index: defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/DevClassLoadingHook.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/DevClassLoadingHook.java,v >retrieving revision 1.5 >diff -u -r1.5 DevClassLoadingHook.java >--- defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/DevClassLoadingHook.java 24 Apr 2009 20:30:52 -0000 1.5 >+++ defaultAdaptor/src/org/eclipse/osgi/internal/baseadaptor/DevClassLoadingHook.java 5 Nov 2009 23:18:02 -0000 >@@ -26,6 +26,7 @@ > public class DevClassLoadingHook implements ClassLoadingHook, HookConfigurator, KeyedElement { > public static final String KEY = DevClassLoadingHook.class.getName(); > public static final int HASHCODE = KEY.hashCode(); >+ private static final String FRAGMENT = "@fragment@"; //$NON-NLS-1$ > > public byte[] processClass(String name, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager) { > // Do nothing >@@ -47,11 +48,17 @@ > else { > // if in dev mode, try using the cp as an absolute path > // we assume absolute entries come from fragments. Find the source >- BaseData fragData = findFragmentSource(sourcedata, devClassPath[i], hostmanager); >- ClasspathEntry entry = hostmanager.getExternalClassPath(devClassPath[i], fragData, sourcedomain); >- if (entry != null) { >- cpEntries.add(entry); >- result = true; >+ String devCP = devClassPath[i]; >+ boolean fromFragment = devCP.startsWith(FRAGMENT); >+ if (fromFragment) >+ devCP = devCP.substring(FRAGMENT.length()); >+ BaseData fragData = findFragmentSource(sourcedata, devCP, hostmanager, fromFragment); >+ if (fragData != null) { >+ ClasspathEntry entry = hostmanager.getExternalClassPath(devCP, fragData, sourcedomain); >+ if (entry != null) { >+ cpEntries.add(entry); >+ result = true; >+ } > } > } > } >@@ -62,9 +69,10 @@ > return result; > } > >- private BaseData findFragmentSource(BaseData hostData, String cp, ClasspathManager manager) { >+ private BaseData findFragmentSource(BaseData hostData, String cp, ClasspathManager manager, boolean fromFragment) { > if (hostData != manager.getBaseData()) > return hostData; >+ > File file = new File(cp); > if (!file.isAbsolute()) > return hostData; >@@ -75,7 +83,7 @@ > if (fragFile != null && file.getPath().startsWith(fragFile.getPath())) > return fragCP[i].getBundleData(); > } >- return hostData; >+ return fromFragment ? null : hostData; > } > > public String findLibrary(BaseData data, String libName) { >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/ClasspathHelper.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/ClasspathHelper.java,v >retrieving revision 1.27 >diff -u -r1.27 ClasspathHelper.java >--- src/org/eclipse/pde/internal/core/ClasspathHelper.java 22 Apr 2008 03:46:18 -0000 1.27 >+++ src/org/eclipse/pde/internal/core/ClasspathHelper.java 5 Nov 2009 23:18:04 -0000 >@@ -311,7 +311,7 @@ > } > IPath[] paths = findLibrary(libName, project, classpathMap, build); > if (paths.length > 0) >- return paths; >+ return prefixFragmentAnnotation(paths); > > } catch (JavaModelException e) { > continue; >@@ -322,13 +322,19 @@ > if (file.isDirectory()) { > file = new File(file, libName); > if (file.exists()) >- return new IPath[] {new Path(file.getPath())}; >+ return new IPath[] {new Path("@fragment@" + file.getPath())}; > } > } > } > return new IPath[0]; > } > >+ private static IPath[] prefixFragmentAnnotation(IPath[] paths) { >+ for (int i = 0; i < paths.length; i++) >+ paths[i] = new Path("@fragment@" + paths[i].toString()); >+ return paths; >+ } >+ > private static void addPath(ArrayList result, IProject project, IPath path) { > IPath resultPath = null; > if (path.isAbsolute())
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 294211
:
151313
|
151314
|
151329
|
151515
|
151617
|
151621