|
Lines 35-40
Link Here
|
| 35 |
import org.eclipse.jdt.debug.core.IJavaClassType; |
35 |
import org.eclipse.jdt.debug.core.IJavaClassType; |
| 36 |
import org.eclipse.jdt.debug.core.IJavaFieldVariable; |
36 |
import org.eclipse.jdt.debug.core.IJavaFieldVariable; |
| 37 |
import org.eclipse.jdt.debug.core.IJavaObject; |
37 |
import org.eclipse.jdt.debug.core.IJavaObject; |
|
|
38 |
import org.eclipse.jdt.debug.core.IJavaReferenceType; |
| 38 |
import org.eclipse.jdt.debug.core.IJavaStackFrame; |
39 |
import org.eclipse.jdt.debug.core.IJavaStackFrame; |
| 39 |
import org.eclipse.jdt.launching.IRuntimeClasspathEntry; |
40 |
import org.eclipse.jdt.launching.IRuntimeClasspathEntry; |
| 40 |
import org.eclipse.jdt.launching.JavaRuntime; |
41 |
import org.eclipse.jdt.launching.JavaRuntime; |
|
Lines 43-51
Link Here
|
| 43 |
import org.eclipse.pde.core.plugin.IPluginModelBase; |
44 |
import org.eclipse.pde.core.plugin.IPluginModelBase; |
| 44 |
import org.eclipse.pde.core.plugin.ModelEntry; |
45 |
import org.eclipse.pde.core.plugin.ModelEntry; |
| 45 |
import org.eclipse.pde.core.plugin.PluginRegistry; |
46 |
import org.eclipse.pde.core.plugin.PluginRegistry; |
| 46 |
import org.eclipse.pde.internal.core.TargetPlatformHelper; |
|
|
| 47 |
import org.eclipse.pde.internal.core.PDEClasspathContainer; |
47 |
import org.eclipse.pde.internal.core.PDEClasspathContainer; |
| 48 |
import org.eclipse.pde.internal.core.PDECore; |
48 |
import org.eclipse.pde.internal.core.PDECore; |
|
|
49 |
import org.eclipse.pde.internal.core.TargetPlatformHelper; |
| 49 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
50 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
| 50 |
|
51 |
|
| 51 |
public class PDESourceLookupQuery implements ISafeRunnable { |
52 |
public class PDESourceLookupQuery implements ISafeRunnable { |
|
Lines 66-89
Link Here
|
| 66 |
} |
67 |
} |
| 67 |
|
68 |
|
| 68 |
public void run() throws Exception { |
69 |
public void run() throws Exception { |
|
|
70 |
IJavaObject classLoaderObject = null; |
| 71 |
String declaringTypeName = null; |
| 72 |
String sourcePath = null; |
| 69 |
if (fElement instanceof IJavaStackFrame) { |
73 |
if (fElement instanceof IJavaStackFrame) { |
| 70 |
IJavaStackFrame stackFrame = (IJavaStackFrame)fElement; |
74 |
IJavaStackFrame stackFrame = (IJavaStackFrame)fElement; |
| 71 |
String typeName = generateSourceName(stackFrame.getDeclaringTypeName()); |
75 |
classLoaderObject = stackFrame.getReferenceType().getClassLoaderObject(); |
| 72 |
|
76 |
declaringTypeName = stackFrame.getDeclaringTypeName(); |
| 73 |
IJavaObject object = stackFrame.getReferenceType().getClassLoaderObject(); |
77 |
sourcePath = generateSourceName(declaringTypeName); |
| 74 |
if (object != null) { |
78 |
} else if (fElement instanceof IJavaObject){ |
| 75 |
IJavaClassType type = (IJavaClassType)object.getJavaType(); |
79 |
IJavaObject object = (IJavaObject)fElement; |
| 76 |
if (OSGI_CLASSLOADER.equals(type.getName())) { |
80 |
IJavaReferenceType type = (IJavaReferenceType)object.getJavaType(); |
| 77 |
fResult = findSourceElement(object, typeName); |
81 |
classLoaderObject = type.getClassLoaderObject(); |
| 78 |
} else if (LEGACY_ECLIPSE_CLASSLOADER.equals(type.getName())) { |
82 |
if (object.getJavaType() != null){ |
| 79 |
fResult = findSourceElement_legacy(object, typeName); |
83 |
declaringTypeName = object.getJavaType().getName(); |
| 80 |
} else if (MAIN_CLASS.equals(stackFrame.getDeclaringTypeName())){ |
|
|
| 81 |
IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(MAIN_PLUGIN); |
| 82 |
if (model != null) |
| 83 |
fResult = getSourceElement(model.getInstallLocation(), MAIN_PLUGIN, typeName); |
| 84 |
} |
| 85 |
} |
84 |
} |
|
|
85 |
if (declaringTypeName != null){ |
| 86 |
sourcePath = generateSourceName(declaringTypeName); |
| 87 |
} |
| 88 |
} else if (fElement instanceof IJavaReferenceType){ |
| 89 |
IJavaReferenceType type = (IJavaReferenceType)fElement; |
| 90 |
classLoaderObject = type.getClassLoaderObject(); |
| 91 |
declaringTypeName = type.getName(); |
| 92 |
sourcePath = generateSourceName(declaringTypeName); |
| 86 |
} |
93 |
} |
|
|
94 |
|
| 95 |
if (classLoaderObject != null) { |
| 96 |
IJavaClassType type = (IJavaClassType)classLoaderObject.getJavaType(); |
| 97 |
if (OSGI_CLASSLOADER.equals(type.getName())) { |
| 98 |
fResult = findSourceElement(classLoaderObject, sourcePath); |
| 99 |
} else if (LEGACY_ECLIPSE_CLASSLOADER.equals(type.getName())) { |
| 100 |
fResult = findSourceElement_legacy(classLoaderObject, sourcePath); |
| 101 |
} else if (MAIN_CLASS.equals(declaringTypeName)){ |
| 102 |
IPluginModelBase model = PDECore.getDefault().getModelManager().findModel(MAIN_PLUGIN); |
| 103 |
if (model != null) |
| 104 |
fResult = getSourceElement(model.getInstallLocation(), MAIN_PLUGIN, sourcePath); |
| 105 |
} |
| 106 |
} |
| 107 |
|
| 87 |
} |
108 |
} |
| 88 |
|
109 |
|
| 89 |
protected Object getResult() { |
110 |
protected Object getResult() { |