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 151621 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]
Updated PDE + framework patch
294211.patch (text/plain), 4.64 KB, created by
Thomas Watson
on 2009-11-06 21:10:40 EST
(
hide
)
Description:
Updated PDE + framework patch
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2009-11-06 21:10:40 EST
Size:
4.64 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 7 Nov 2009 02:12:13 -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.endsWith(FRAGMENT); >+ if (fromFragment) >+ devCP = devCP.substring(0, devCP.length() - 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 7 Nov 2009 02:12:22 -0000 >@@ -25,6 +25,7 @@ > public class ClasspathHelper { > > private static final String DOT = "."; //$NON-NLS-1$ >+ private static final String FRAGMENT_ANNOTATION = "@fragment@"; //$NON-NLS-1$ > > public static String getDevEntriesProperties(String fileName, boolean checkExcluded) { > File file = new File(fileName); >@@ -311,7 +312,7 @@ > } > IPath[] paths = findLibrary(libName, project, classpathMap, build); > if (paths.length > 0) >- return paths; >+ return postfixFragmentAnnotation(paths); > > } catch (JavaModelException e) { > continue; >@@ -322,13 +323,24 @@ > if (file.isDirectory()) { > file = new File(file, libName); > if (file.exists()) >- return new IPath[] {new Path(file.getPath())}; >+ // Postfix fragment annotation for fragment path (fix bug 294211) >+ return new IPath[] {new Path(file.getPath() + FRAGMENT_ANNOTATION)}; > } > } > } > return new IPath[0]; > } > >+ /* >+ * Postfixes the fragment annotation for the paths that we know come >+ * from fragments. This is needed to fix bug 294211. >+ */ >+ private static IPath[] postfixFragmentAnnotation(IPath[] paths) { >+ for (int i = 0; i < paths.length; i++) >+ paths[i] = new Path(paths[i].toString() + FRAGMENT_ANNOTATION); >+ 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