Skip to content

Commit 7d7e88a

Browse files
committed
Even more javadocs
1 parent 6a1d2bb commit 7d7e88a

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JDIDebugUIPreferenceInitializer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.eclipse.jdt.debug.ui.IJavaDebugUIConstants;
2121
import org.eclipse.jface.preference.IPreferenceStore;
2222
import org.eclipse.jface.util.PropertyChangeEvent;
23+
import org.eclipse.jface.util.Util;
2324

2425
public class JDIDebugUIPreferenceInitializer extends AbstractPreferenceInitializer {
2526

@@ -47,9 +48,9 @@ public void initializeDefaultPreferences() {
4748
store.setDefault(IJDIPreferencesConstants.PREF_STEP_THRU_FILTERS, true);
4849

4950
store.setDefault(IJDIPreferencesConstants.PREF_ACTIVE_PLATFORM_FRAME_FILTER_LIST, "java.*,javax.*,jdk.*,sun.*,sunw.*,org.junit.*,org.eclipse.jdt.internal.*"); //$NON-NLS-1$
50-
store.setDefault(IJDIPreferencesConstants.PREF_INACTIVE_PLATFORM_FRAME_FILTER_LIST, ""); //$NON-NLS-1$
51-
store.setDefault(IJDIPreferencesConstants.PREF_ACTIVE_CUSTOM_FRAME_FILTER_LIST, ""); //$NON-NLS-1$
52-
store.setDefault(IJDIPreferencesConstants.PREF_INACTIVE_CUSTOM_FRAME_FILTER_LIST, ""); //$NON-NLS-1$
51+
store.setDefault(IJDIPreferencesConstants.PREF_INACTIVE_PLATFORM_FRAME_FILTER_LIST, Util.ZERO_LENGTH_STRING);
52+
store.setDefault(IJDIPreferencesConstants.PREF_ACTIVE_CUSTOM_FRAME_FILTER_LIST, Util.ZERO_LENGTH_STRING);
53+
store.setDefault(IJDIPreferencesConstants.PREF_INACTIVE_CUSTOM_FRAME_FILTER_LIST, Util.ZERO_LENGTH_STRING);
5354
store.setDefault(IJDIPreferencesConstants.PREF_COLLAPSE_STACK_FRAMES, true);
5455

5556
store.setDefault(IDebugUIConstants.ID_VARIABLE_VIEW + "." + IJDIPreferencesConstants.PREF_SHOW_CONSTANTS, false); //$NON-NLS-1$

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/StackFramePresentationProvider.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ private boolean isEnabled(@SuppressWarnings("unused") Category category) {
137137
}
138138

139139
/**
140-
* Visible for testing!
140+
* Categorize the given {@link IJavaStackFrame} into a {@link Category} based on the rules and filters, and where those classes are in the
141+
* project. For example if in a source folder, in a library or in a test source folder, etc.
141142
*/
142143
public IJavaStackFrame.Category categorize(IJavaStackFrame frame) throws DebugException {
143144
var refTypeName = frame.getReferenceType().getName();
@@ -154,6 +155,10 @@ public IJavaStackFrame.Category categorize(IJavaStackFrame frame) throws DebugEx
154155
return categorizeSourceElement(frame);
155156
}
156157

158+
/**
159+
* Do the categorization with the help of a {@link org.eclipse.debug.core.model.ISourceLocator} coming from the associated
160+
* {@link org.eclipse.debug.core.ILaunch}. This is how we can find, if the class file is in a jar or comes from a source folder.
161+
*/
157162
private Category categorizeSourceElement(IJavaStackFrame frame) {
158163
var sourceLocator = frame.getLaunch().getSourceLocator();
159164
if (sourceLocator == null) {
@@ -180,6 +185,9 @@ private Category categorizeSourceElement(IJavaStackFrame frame) {
180185
return Category.UNKNOWN;
181186
}
182187

188+
/**
189+
* Unsubscribes to not receive notifications from the {@link IPreferenceStore}.
190+
*/
183191
public void close() {
184192
store.removePropertyChangeListener(this);
185193
}
@@ -196,6 +204,9 @@ public void propertyChange(PropertyChangeEvent event) {
196204
}
197205
}
198206

207+
/**
208+
* @return if stack frames should be collapsed.
209+
*/
199210
public boolean isCollapseStackFrames() {
200211
return collapseStackFrames;
201212
}

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/actions/CollapseStackFramesAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2022 Zsombor Gegesy and others.
2+
* Copyright (c) 2022, 2025 Zsombor Gegesy and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ protected int getChildCount(Object element, IPresentationContext context, IViewe
7171
return childCount;
7272
}
7373

74+
/**
75+
* return the number of child objects for the given {@link IJavaThread}, either the number of frames, or if frame grouping is enabled, the
76+
* {@link GroupedStackFrame}s are properly accounted.
77+
*/
7478
private int getFrameCount(IJavaThread thread) throws DebugException {
7579
if (getStackFrameProvider().isCollapseStackFrames()) {
7680
return getStackFrames(thread).size();

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public class MonitorsAdapterFactory implements IAdapterFactory {
4040
@SuppressWarnings("unchecked")
4141
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
4242

43-
if (IElementContentProvider.class.equals(adapterType)) {
44-
if (adaptableObject instanceof IJavaThread || adaptableObject instanceof GroupedStackFrame) {
45-
return (T) getThreadPresentation();
46-
}
47-
if (adaptableObject instanceof IJavaStackFrame) {
43+
if (IElementContentProvider.class.equals(adapterType)) {
44+
if (adaptableObject instanceof IJavaThread || adaptableObject instanceof GroupedStackFrame) {
45+
return (T) getThreadPresentation();
46+
}
47+
if (adaptableObject instanceof IJavaStackFrame) {
4848
return (T) fgCPFrame;
4949
}
5050
if (adaptableObject instanceof JavaOwnedMonitor) {

0 commit comments

Comments
 (0)