Skip to content

Commit fc59a6d

Browse files
committed
Sync the getCategory call, add explicit types a couple of places
1 parent 84bc37e commit fc59a6d

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/monitors/JavaThreadContentProvider.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.eclipse.core.runtime.jobs.ISchedulingRule;
2222
import org.eclipse.debug.core.DebugException;
2323
import org.eclipse.debug.core.model.IDebugElement;
24+
import org.eclipse.debug.core.model.IStackFrame;
2425
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
2526
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
2627
import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
@@ -107,7 +108,7 @@ protected Object[] getChildren(IJavaThread thread) {
107108
}
108109
}
109110
}
110-
var frames = getStackFrames(thread);
111+
List<IDebugElement> frames = getStackFrames(thread);
111112
if (!isDisplayMonitors()) {
112113
return frames.toArray();
113114
}
@@ -137,10 +138,10 @@ protected Object[] getChildren(IJavaThread thread) {
137138
* {@link Category#TEST} and {@link Category#CUSTOM_FILTERED} grouped into {@link GroupedStackFrame}s, those are folded by default, but can be
138139
* expanded on demand by the user.
139140
*/
140-
private List<Object> getStackFrames(IJavaThread thread) throws DebugException {
141-
var frames = thread.getStackFrames();
141+
private List<IDebugElement> getStackFrames(IJavaThread thread) throws DebugException {
142+
IStackFrame[] frames = thread.getStackFrames();
142143
var stackFrameProvider = getStackFrameProvider();
143-
var result = new ArrayList<>(frames.length);
144+
var result = new ArrayList<IDebugElement>(frames.length);
144145
if (!stackFrameProvider.isCollapseStackFrames()) {
145146
result.addAll(Arrays.asList(frames));
146147
return result;

org.eclipse.jdt.debug/model/org/eclipse/jdt/internal/debug/core/model/JDIStackFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ public void setIsTop(boolean isTop) {
17341734
}
17351735

17361736
@Override
1737-
public Category getCategory() {
1737+
public synchronized Category getCategory() {
17381738
if (fCategory == null) {
17391739
fCategory = JDIDebugPlugin.getDefault().getStackFrameCategorizer().categorize(this);
17401740
}

0 commit comments

Comments
 (0)