@@ -659,8 +659,7 @@ private void handleEditButtonPressed() {
659659 TableItem selection = items [0 ];
660660 if (selection != null ) {
661661 Object data = selection .getData ();
662- if (data instanceof ILaunchConfiguration ) {
663- ILaunchConfiguration config = (ILaunchConfiguration ) data ;
662+ if (data instanceof ILaunchConfiguration config ) {
664663 userHasMadeChanges = true ;
665664 boolean wasAutobuilding = ResourcesPlugin .getWorkspace ().getDescription ().isAutoBuilding ();
666665 try {
@@ -675,8 +674,7 @@ private void handleEditButtonPressed() {
675674 handleException (e );
676675 }
677676 }
678- } else if (data instanceof ICommand ) {
679- ICommand command = (ICommand ) data ;
677+ } else if (data instanceof ICommand command ) {
680678 if (command .isConfigurable ()) {
681679 if (editCommand (command )) {
682680 userHasMadeChanges = true ;
@@ -739,8 +737,7 @@ private void handleTableSelectionChanged() {
739737 }
740738 for (TableItem item : items ) {
741739 Object data = item .getData ();
742- if (data instanceof ILaunchConfiguration ) {
743- ILaunchConfiguration config = (ILaunchConfiguration )data ;
740+ if (data instanceof ILaunchConfiguration config ) {
744741 String builderName = null ;
745742 try {
746743 builderName = config .getAttribute (IExternalToolConstants .ATTR_DISABLED_BUILDER , (String )null );
@@ -779,8 +776,7 @@ private void handleTableSelectionChanged() {
779776 * @return whether the given element is enabled
780777 */
781778 private boolean isEnabled (Object element ) {
782- if (element instanceof ICommand ) {
783- ICommand command = (ICommand ) element ;
779+ if (element instanceof ICommand command ) {
784780 String val = command .getArguments ().get (COMMAND_ENABLED );
785781 if (val != null ) {
786782 //null means enabled, see #doPerformOk
@@ -906,8 +902,7 @@ private void doPerformOk(IProgressMonitor monitor, Object[] itemData) {
906902 command .setArguments (args );
907903 }
908904 }
909- } else if (data instanceof ILaunchConfiguration ) {
910- ILaunchConfiguration config = (ILaunchConfiguration ) data ;
905+ } else if (data instanceof ILaunchConfiguration config ) {
911906 String disabledBuilderName ;
912907 try {
913908 disabledBuilderName = config .getAttribute (IExternalToolConstants .ATTR_DISABLED_BUILDER , (String )null );
@@ -917,8 +912,7 @@ private void doPerformOk(IProgressMonitor monitor, Object[] itemData) {
917912 }
918913 } catch (CoreException e1 ) {
919914 }
920- if (config instanceof ILaunchConfigurationWorkingCopy ) {
921- ILaunchConfigurationWorkingCopy workingCopy = ((ILaunchConfigurationWorkingCopy ) config );
915+ if (config instanceof ILaunchConfigurationWorkingCopy workingCopy ) {
922916 // Save any changes to the config (such as enable/disable)
923917 if (workingCopy .isDirty ()) {
924918 try {
@@ -1133,8 +1127,7 @@ public boolean performCancel() {
11331127 int numCommands = builderTable .getItemCount ();
11341128 for (int i = 0 ; i < numCommands ; i ++) {
11351129 Object data = builderTable .getItem (i ).getData ();
1136- if (data instanceof ICommand ) {
1137- ICommand command = (ICommand )data ;
1130+ if (data instanceof ICommand command ) {
11381131 Map <String , String > args = command .getArguments ();
11391132 args .remove (COMMAND_ENABLED );
11401133 command .setArguments (args );
0 commit comments