Skip to content

Commit 2c2c803

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 2c2c803

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,13 +1416,14 @@ 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+
IPreferenceStore store = getDefault().getPreferenceStore();
1420+
if (store.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 (store.getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED)) {
14231424
ret &= new DeletedProjectFilter().select(null, null, config);
14241425
}
1425-
if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES)) {
1426+
if (store.getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES)) {
14261427
try {
14271428
ret &= new LaunchConfigurationTypeFilter().select(null, null, config.getType());
14281429
}

0 commit comments

Comments
 (0)