summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2012-11-21 16:41:48 (EST)
committer Mike Rennie2012-11-21 16:43:18 (EST)
commitde526943120915e44f4ea1792f6445ffd1ef0efa (patch)
tree4550ac7aedbf29614e453deea55ba777e7836a84
parent07c5f52b120128c0562ef7dc7ed2aed8388a2e68 (diff)
downloadeclipse.jdt.debug-de526943120915e44f4ea1792f6445ffd1ef0efa.zip
eclipse.jdt.debug-de526943120915e44f4ea1792f6445ffd1ef0efa.tar.gz
eclipse.jdt.debug-de526943120915e44f4ea1792f6445ffd1ef0efa.tar.bz2
Bug 368212 - JavaLineBreakpoint.computeJavaProject does not let
ISourceLocator evaluate the stackFrame
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java34
-rw-r--r--org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java15
2 files changed, 22 insertions, 27 deletions
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java
index 31cce40..cd5c4c2 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Igor Fedorenko - Bug 368212 - JavaLineBreakpoint.computeJavaProject does not let ISourceLocator evaluate the stackFrame
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.breakpoints;
@@ -470,25 +471,24 @@ public class JavaLineBreakpoint extends JavaBreakpoint implements
if (locator == null)
return null;
- Object sourceElement = null;
- try {
- if (locator instanceof ISourceLookupDirector
- && !stackFrame.isStatic()) {
- IJavaType thisType = stackFrame.getThis().getJavaType();
- if (thisType instanceof IJavaReferenceType) {
- String[] sourcePaths = ((IJavaReferenceType) thisType)
- .getSourcePaths(null);
- if (sourcePaths != null && sourcePaths.length > 0) {
- sourceElement = ((ISourceLookupDirector) locator)
- .getSourceElement(sourcePaths[0]);
+ Object sourceElement = locator.getSourceElement(stackFrame);
+ if (sourceElement == null) {
+ try {
+ if (locator instanceof ISourceLookupDirector
+ && !stackFrame.isStatic()) {
+ IJavaType thisType = stackFrame.getThis().getJavaType();
+ if (thisType instanceof IJavaReferenceType) {
+ String[] sourcePaths = ((IJavaReferenceType) thisType)
+ .getSourcePaths(null);
+ if (sourcePaths != null && sourcePaths.length > 0) {
+ sourceElement = ((ISourceLookupDirector) locator)
+ .getSourceElement(sourcePaths[0]);
+ }
}
}
+ } catch (DebugException e) {
+ DebugPlugin.log(e);
}
- } catch (DebugException e) {
- DebugPlugin.log(e);
- }
- if (sourceElement == null) {
- sourceElement = locator.getSourceElement(stackFrame);
}
if (!(sourceElement instanceof IJavaElement)
&& sourceElement instanceof IAdaptable) {
diff --git a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java
index 7280d1d..495c21e 100644
--- a/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java
+++ b/org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2012 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Igor Fedorenko - Bug 368212 - JavaLineBreakpoint.computeJavaProject does not let ISourceLocator evaluate the stackFrame
*******************************************************************************/
package org.eclipse.jdt.internal.debug.core.logicalstructures;
@@ -290,21 +291,15 @@ public class JavaLogicalStructure implements ILogicalStructureType {
// find the project the snippets will be compiled in.
ISourceLocator locator = javaValue.getLaunch().getSourceLocator();
- Object sourceElement = null;
- if (locator instanceof ISourceLookupDirector) {
+ Object sourceElement = locator.getSourceElement(stackFrame);
+ if (sourceElement == null && locator instanceof ISourceLookupDirector) {
String[] sourcePaths = type.getSourcePaths(null);
if (sourcePaths != null && sourcePaths.length > 0) {
sourceElement = ((ISourceLookupDirector) locator)
.getSourceElement(sourcePaths[0]);
}
- if (!(sourceElement instanceof IJavaElement)
- && sourceElement instanceof IAdaptable) {
- sourceElement = ((IAdaptable) sourceElement)
- .getAdapter(IJavaElement.class);
- }
}
- if (sourceElement == null) {
- sourceElement = locator.getSourceElement(stackFrame);
+ if (sourceElement != null) {
if (!(sourceElement instanceof IJavaElement)
&& sourceElement instanceof IAdaptable) {
sourceElement = ((IAdaptable) sourceElement)