Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-06-05 16:32:23 +0000
committerKarsten Thoms2020-06-10 08:14:22 +0000
commite0e23692a403dfb467b83400f7729f3e490385c6 (patch)
tree6f7b3b19a0670a69bbd847ce21d6da7b3be93605
parent643b927aa1a70d1687c2bbccceb0110d3d14b3bb (diff)
downloadeclipse.platform.debug-e0e23692a403dfb467b83400f7729f3e490385c6.tar.gz
eclipse.platform.debug-e0e23692a403dfb467b83400f7729f3e490385c6.tar.xz
eclipse.platform.debug-e0e23692a403dfb467b83400f7729f3e490385c6.zip
Bug 564117 - Using lazy logical operatorI20200610-1800
Use lazy logical operator (&& and ||) as it is potentially faster. Change-Id: I73f4bae34305b349af92986f4c9b845b6a4d241a Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/hover/ExpressionInformationControlCreator.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java2
7 files changed, 9 insertions, 9 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
index 9b4d8dc9f..9f460fdc1 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java
@@ -896,7 +896,7 @@ public class LaunchConfigurationInfo {
String strAttr1 = null;
String strAttr2 = null;
if (fgIsSun14x) {
- if(attr2 instanceof String & attr1 instanceof String) {
+ if(attr2 instanceof String && attr1 instanceof String) {
// this is a hack for bug 110215, on SUN 1.4.x, \r
// is stripped off when the stream is written to the
// DOM
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
index 926761748..ad5ac4245 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java
@@ -1630,7 +1630,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
LaunchDelegate delegate = getLaunchDelegateExtension(typeid, delegateid, modeset);
if (delegate != null) {
//take type id, modeset, delegate and create entry
- if(!IInternalDebugCoreConstants.EMPTY_STRING.equals(typeid) & modeset != null) {
+ if(!IInternalDebugCoreConstants.EMPTY_STRING.equals(typeid) && modeset != null) {
fPreferredDelegates.add(new PreferredDelegate(delegate, typeid, modeset));
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/hover/ExpressionInformationControlCreator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/hover/ExpressionInformationControlCreator.java
index a0086d77d..8d9940f0b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/hover/ExpressionInformationControlCreator.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/hover/ExpressionInformationControlCreator.java
@@ -195,7 +195,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
private IDialogSettings getDialogSettings(boolean create) {
IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(this.getClass().getName());
- if (section == null & create) {
+ if (section == null && create) {
section = settings.addNewSection(this.getClass().getName());
}
return section;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
index 378ab54a8..7465864ee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
@@ -254,8 +254,8 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
onechecked = true;
}
}
- fViewer.setGrayed(parent, onechecked & !checked);
- fViewer.setChecked(parent, checked | onechecked);
+ fViewer.setGrayed(parent, onechecked && !checked);
+ fViewer.setChecked(parent, checked || onechecked);
}
}
@@ -366,7 +366,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
errors.add(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_19, new Object[] { launchConfig.getName() }), null));
} else {
newfile = new File(destpath.append(file.getName()).toOSString());
- if(newfile.exists() & !overwrite) {
+ if(newfile.exists() && !overwrite) {
if(nowall) {
continue;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
index bd62dc8ea..aa77749bf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
@@ -174,7 +174,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
for (Object resource : getSelectedResources()) {
config = (File) ((DebugFileSystemElement) resource).getFileSystemObject();
newconfig = new File(new Path(LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.toOSString()).append(config.getName()).toOSString());
- if(newconfig.exists() & !overwrite) {
+ if(newconfig.exists() && !overwrite) {
if(nowall) {
continue;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
index eb21df180..8f65c3997 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
@@ -108,7 +108,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
try {
int width = settings.getInt("DIALOG_WIDTH"); //$NON-NLS-1$
int height = settings.getInt("DIALOG_HEIGHT"); //$NON-NLS-1$
- if(width > 0 & height > 0) {
+ if(width > 0 && height > 0) {
return new Point(width, height);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
index 8b83c4d4f..e13e758b9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
@@ -576,7 +576,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
sw = memento.getInteger(SASH_DETAILS_PART);
if(sw != null) {
int details = sw.intValue();
- if(view > -1 & details > -1) {
+ if(view > -1 && details > -1) {
return new int[] {view, details};
}
}

Back to the top