View | Details | Raw Unified | Return to bug 141027 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java (-16 / +39 lines)
Lines 11-17 Link Here
11
package org.eclipse.jdt.internal.debug.core.model;
11
package org.eclipse.jdt.internal.debug.core.model;
12
12
13
 
13
 
14
import com.ibm.icu.text.MessageFormat;
15
import java.util.ArrayList;
14
import java.util.ArrayList;
16
import java.util.Collections;
15
import java.util.Collections;
17
import java.util.Comparator;
16
import java.util.Comparator;
Lines 36-41 Link Here
36
import org.eclipse.jdt.debug.core.IJavaVariable;
35
import org.eclipse.jdt.debug.core.IJavaVariable;
37
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
36
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
38
37
38
import com.ibm.icu.text.MessageFormat;
39
import com.sun.jdi.AbsentInformationException;
39
import com.sun.jdi.AbsentInformationException;
40
import com.sun.jdi.ClassType;
40
import com.sun.jdi.ClassType;
41
import com.sun.jdi.Field;
41
import com.sun.jdi.Field;
Lines 148-159 Link Here
148
				return null;
148
				return null;
149
			} else if (fDepth == depth) {
149
			} else if (fDepth == depth) {
150
				Location location = frame.location();
150
				Location location = frame.location();
151
				if (location.method().equals(fLocation.method())) {
151
				Method method = location.method();
152
					// TODO: what about receiving type being the same?
152
				if (method.equals(fLocation.method())) {
153
					fStackFrame = frame;
153
					try {
154
					fLocation = location;
154
						if (method.declaringType().defaultStratum().equals("Java") || //$NON-NLS-1$
155
					clearCachedData();
155
						    equals(getSourceName(location), getSourceName(fLocation))) {
156
					return this;
156
							// TODO: what about receiving type being the same?
157
							fStackFrame = frame;
158
							fLocation = location;
159
							clearCachedData();
160
							return this;
161
						}
162
					} catch (DebugException e) {
163
					}
157
				}
164
				}
158
			}
165
			}
159
			// invalidate this franme
166
			// invalidate this franme
Lines 870-886 Link Here
870
	 */
877
	 */
871
	public String getSourceName() throws DebugException {
878
	public String getSourceName() throws DebugException {
872
		synchronized (fThread) {
879
		synchronized (fThread) {
873
			try {
880
			return getSourceName(fLocation); 
874
				return fLocation.sourceName();
881
		}
875
			} catch (AbsentInformationException e) {
882
	}
876
				return null;
883
	
877
			} catch (NativeMethodException e) {
884
	/**
878
				return null;
885
	 * Returns the source from the default stratum of the given location
879
			} catch (RuntimeException e) {
886
	 * or <code>null</code> if not available (missing attribute).
880
				targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_name, new String[] {e.toString()}), e); 
887
	 */
881
			}
888
	private String getSourceName(Location location) throws DebugException {
889
		try {
890
			return location.sourceName();
891
		} catch (AbsentInformationException e) {
892
			return null;
893
		} catch (NativeMethodException e) {
894
			return null;
895
		} catch (RuntimeException e) {
896
			targetRequestFailed(MessageFormat.format(JDIDebugModelMessages.JDIStackFrame_exception_retrieving_source_name, new String[] {e.toString()}), e); 
882
		}
897
		}
883
		return null;
898
		return null;
899
	}	
900
	
901
	private boolean equals(Object o1, Object o2) {
902
		if (o1 == null) {
903
			return o2 == null;
904
		} else {
905
			return o1.equals(o2);
906
		}
884
	}
907
	}
885
	
908
	
886
	protected boolean isTopStackFrame() throws DebugException {
909
	protected boolean isTopStackFrame() throws DebugException {

Return to bug 141027