File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -107,14 +107,14 @@ protected boolean updateSelection(IStructuredSelection selection) {
107107 // Enable action only if launch configuration(s) of the same type
108108 // is(are) selected and the launch configuration type allows prototypes
109109 Collection <ILaunchConfigurationType > launchConfigurationTypes = new HashSet <>();
110+ ILaunchConfigurationType type = null ;
110111 for (Object object : selection .toList ()) {
111- if (object instanceof ILaunchConfiguration ) {
112- if ((( ILaunchConfiguration ) object ) .isPrototype ()) {
112+ if (object instanceof ILaunchConfiguration launchConfig ) {
113+ if (launchConfig .isPrototype ()) {
113114 return false ;
114115 } else {
115- ILaunchConfigurationType type = null ;
116116 try {
117- type = (( ILaunchConfiguration ) object ) .getType ();
117+ type = launchConfig .getType ();
118118 } catch (CoreException e ) {
119119 DebugUIPlugin .log (e .getStatus ());
120120 }
@@ -128,8 +128,13 @@ protected boolean updateSelection(IStructuredSelection selection) {
128128 return false ;
129129 }
130130 }
131- if (launchConfigurationTypes .size () == 1 ) {
132- return launchConfigurationTypes .iterator ().next ().supportsPrototypes ();
131+
132+ if (launchConfigurationTypes .size () == 1 && type != null ) {
133+ try {
134+ return type .getPrototypes ().length > 0 ;
135+ } catch (CoreException e ) {
136+ DebugUIPlugin .log (e );
137+ }
133138 }
134139 return false ;
135140 }
You can’t perform that action at this time.
0 commit comments