Skip to content

Commit 9a856b9

Browse files
committed
Refactor launch configuration filtering to reuse preference store
Cache the preference store in doLaunchConfigurationFiltering(ILaunchConfiguration) instead of repeatedly calling getDefault().getPreferenceStore(). This improves readability and reduces redundant method calls without changing existing behavior.
1 parent a877760 commit 9a856b9

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2025 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -1416,13 +1416,16 @@ public static ImageDescriptor getImageDescriptor(String bundleName, String path)
14161416
*/
14171417
public static boolean doLaunchConfigurationFiltering(ILaunchConfiguration config) {
14181418
boolean ret = true;
1419-
if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED)) {
1419+
if (DebugUIPlugin.getDefault().getPreferenceStore()
1420+
.getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED)) {
14201421
ret &= new ClosedProjectFilter().select(null, null, config);
14211422
}
1422-
if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED)) {
1423+
if (DebugUIPlugin.getDefault().getPreferenceStore()
1424+
.getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED)) {
14231425
ret &= new DeletedProjectFilter().select(null, null, config);
14241426
}
1425-
if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES)) {
1427+
if (DebugUIPlugin.getDefault().getPreferenceStore()
1428+
.getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES)) {
14261429
try {
14271430
ret &= new LaunchConfigurationTypeFilter().select(null, null, config.getType());
14281431
}

0 commit comments

Comments
 (0)