Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis Windatt2013-02-28 20:51:12 +0000
committerCurtis Windatt2013-02-28 20:51:12 +0000
commit98756305ad049a92fd101b6d0f4a7a8bbe0f24b1 (patch)
treecb55b4a8a522e3b3727bdddce2be43d603ee01b4
parent3d403a2cf5dd53f7319edd53d074b11a0237fbcc (diff)
downloadeclipse.pde.ui-98756305ad049a92fd101b6d0f4a7a8bbe0f24b1.tar.gz
eclipse.pde.ui-98756305ad049a92fd101b6d0f4a7a8bbe0f24b1.tar.xz
eclipse.pde.ui-98756305ad049a92fd101b6d0f4a7a8bbe0f24b1.zip
Bug 402005 - Add support for source lookup for a new Equinoxv20130228-205112
implementation
-rw-r--r--ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/sourcelookup/PDESourceLookupQuery.java45
1 files changed, 24 insertions, 21 deletions
diff --git a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/sourcelookup/PDESourceLookupQuery.java b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/sourcelookup/PDESourceLookupQuery.java
index 7447d1297c..ff763ffab8 100644
--- a/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/sourcelookup/PDESourceLookupQuery.java
+++ b/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/sourcelookup/PDESourceLookupQuery.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,6 +27,10 @@ import org.eclipse.pde.internal.core.TargetPlatformHelper;
public class PDESourceLookupQuery implements ISafeRunnable {
protected static String OSGI_CLASSLOADER = "org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader"; //$NON-NLS-1$
+ /**
+ * Support for refactored bundle class loaders (bug 402005)
+ */
+ protected static String OSGI_CLASSLOADER2 = "org.eclipse.osgi.internal.loader.ModuleClassLoader"; //$NON-NLS-1$
private static String LEGACY_ECLIPSE_CLASSLOADER = "org.eclipse.core.runtime.adaptor.EclipseClassLoader"; //$NON-NLS-1$
private static String MAIN_CLASS = "org.eclipse.core.launcher.Main"; //$NON-NLS-1$
private static String MAIN_PLUGIN = "org.eclipse.platform"; //$NON-NLS-1$
@@ -80,6 +84,8 @@ public class PDESourceLookupQuery implements ISafeRunnable {
} else {
fResult = findSourceElement(classLoaderObject, sourcePath);
}
+ } else if (OSGI_CLASSLOADER2.equals(type.getName())) {
+ fResult = findSourceElement(classLoaderObject, sourcePath);
} else if (LEGACY_ECLIPSE_CLASSLOADER.equals(type.getName())) {
fResult = findSourceElement_legacy(classLoaderObject, sourcePath);
} else if (MAIN_CLASS.equals(declaringTypeName)) {
@@ -133,28 +139,25 @@ public class PDESourceLookupQuery implements ISafeRunnable {
protected Object findSourceElement(IJavaObject object, String typeName) throws CoreException {
IJavaObject manager = getObject(object, "manager", false); //$NON-NLS-1$
if (manager != null) {
- IJavaObject data = getObject(manager, "data", false); //$NON-NLS-1$
- if (data != null) {
- // search manager's class path for location
- Object result = searchClasspathEntries(manager, typeName);
- if (result != null) {
- return result;
- }
- // then check its fragments
- IJavaObject frgArray = getObject(manager, "fragments", false); //$NON-NLS-1$
- if (frgArray instanceof IJavaArray) {
- IJavaArray fragments = (IJavaArray) frgArray;
- for (int i = 0; i < fragments.getLength(); i++) {
- IJavaObject fragment = (IJavaObject) fragments.getValue(i);
- if (!fragment.isNull()) {
- // search fragment class path
- result = searchClasspathEntries(fragment, typeName);
- if (result != null) {
- return result;
- }
+ // search manager's class path for location
+ Object result = searchClasspathEntries(manager, typeName);
+ if (result != null) {
+ return result;
+ }
+ // then check its fragments
+ IJavaObject frgArray = getObject(manager, "fragments", false); //$NON-NLS-1$
+ if (frgArray instanceof IJavaArray) {
+ IJavaArray fragments = (IJavaArray) frgArray;
+ for (int i = 0; i < fragments.getLength(); i++) {
+ IJavaObject fragment = (IJavaObject) fragments.getValue(i);
+ if (!fragment.isNull()) {
+ // search fragment class path
+ result = searchClasspathEntries(fragment, typeName);
+ if (result != null) {
+ return result;
}
-
}
+
}
}
}

Back to the top