Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-05-24 11:38:39 -0400
committerKarsten Thoms2019-06-11 20:15:41 -0400
commitb17ecf3fcedde66bb379483f57126e59f0cd0e66 (patch)
tree3496d09dce4f3a59d2f48885f23e691278811cf0 /org.eclipse.debug.ui
parent44df04d61c61aac5a356741872258a6e69d37b2f (diff)
downloadeclipse.platform.debug-b17ecf3fcedde66bb379483f57126e59f0cd0e66.tar.gz
eclipse.platform.debug-b17ecf3fcedde66bb379483f57126e59f0cd0e66.tar.xz
eclipse.platform.debug-b17ecf3fcedde66bb379483f57126e59f0cd0e66.zip
Use isEmpty() instead of size()==0 where possible
Change-Id: Iba492570def0a381d0c4a06a5ad3b7c8c8a3419e Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java2
9 files changed, 10 insertions, 10 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
index 340215245..d560fae23 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
@@ -274,7 +274,7 @@ public class LaunchConfigurationPresentationManager {
//otherwise filter based on the collection of delegates for the modes
ILaunchDelegate[] delegates = config.getType().getDelegates(modes);
for(int j = 0; j < delegates.length; j++) {
- if(delegateSet.size() == 0 || delegateSet.contains(delegates[j].getId())) {
+ if(delegateSet.isEmpty() || delegateSet.contains(delegates[j].getId())) {
//associated with all modes and tab groups or only specific ones if indicated
set.add(tabs[i]);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
index 83e0b1026..175603b8c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
@@ -857,7 +857,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* @return true if breakpoint contains in the list of targets.
*/
protected boolean supportsBreakpoint(List<IDebugTarget> targets, IBreakpoint breakpoint) {
- boolean exist = targets.size() == 0 ? true : false;
+ boolean exist = targets.isEmpty() ? true : false;
for (int i = 0; !exist && i < targets.size(); ++i) {
IDebugTarget target = targets.get(i);
exist |= target.supportsBreakpoint(breakpoint);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
index 653d7dacd..754c0e220 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
@@ -290,7 +290,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
pub.add(configurations[i]);
}
}
- if(pub.size() == 0) {
+ if(pub.isEmpty()) {
MessageDialog.openInformation(getShell(), DebugPreferencesMessages.LaunchingPreferencePage_29, DebugPreferencesMessages.LaunchingPreferencePage_30);
return;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java
index 31bbad78d..e16db06c8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java
@@ -42,7 +42,7 @@ public class ResolveDuplicatesHandler implements IStatusHandler {
sources = removeSourceNotFoundEditors(sources);
if(sources.size() == 1) {
return sources.get(0);
- } else if(sources.size() == 0) {
+ } else if(sources.isEmpty()) {
return null;
}
ElementListSelectionDialog dialog = new ElementListSelectionDialog(DebugUIPlugin.getShell(), new SourceElementLabelProvider());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
index 73c59a05b..d0c57d4bd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
@@ -157,7 +157,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
if (fSelectedItem != null) {
fSelectedItem.setFocus(true);
} else {
- if (fBreadcrumbItems.size() == 0) {
+ if (fBreadcrumbItems.isEmpty()) {
return;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
index c1eb4ff2e..6cf38ac23 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
@@ -235,7 +235,7 @@ public class PresentationContext implements IPresentationContext {
* @param memento Memento to save to.
*/
public void saveProperites(IMemento memento) {
- if (fProperties.size() == 0) {
+ if (fProperties.isEmpty()) {
return;
}
IMemento properties = memento.createChild(PRESENTATION_CONTEXT_PROPERTIES, getId());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
index 6e441acac..319dbb85f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
@@ -473,7 +473,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
delta = delta.addNode(container, IModelDelta.UNINSTALL|IModelDelta.REMOVED);
}
- if (container.fChildContainers.size() == 0) {
+ if (container.fChildContainers.isEmpty()) {
List<IBreakpoint> breakpoints = new ArrayList<>();
Iterator<IBreakpoint> iterator = container.fBreakpoints.iterator();
while (iterator.hasNext()) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
index c61129f3a..f3ef6d02f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
@@ -82,7 +82,7 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener {
fRenderings.remove(toRemove[i]);
// remove listener after the last memory block has been removed
- if (fRenderings.size() == 0) {
+ if (fRenderings.isEmpty()) {
DebugPlugin.getDefault().removeDebugEventListener(this);
}
}
@@ -119,7 +119,7 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener {
fRenderings.remove(rendering);
// remove listener after the last memory block has been removed
- if (fRenderings.size() == 0) {
+ if (fRenderings.isEmpty()) {
DebugPlugin.getDefault().removeDebugEventListener(this);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
index 391c87291..ab12e95cc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
@@ -706,7 +706,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
map.put(var.getName(), var.getValue());
}
- if (map.size() == 0) {
+ if (map.isEmpty()) {
configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map<String, String>) null);
} else {
configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, map);

Back to the top