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
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>
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java6
-rw-r--r--org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java2
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java2
-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
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java2
16 files changed, 19 insertions, 19 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java
index 76af4f599..332f6af9e 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java
@@ -534,7 +534,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
* @return true if it is already in the list, false if it is a new object
*/
private boolean checkDuplicate(Object sourceToAdd, List<Object> sources) {
- if(sources.size() == 0) {
+ if(sources.isEmpty()) {
return false;
}
for (Object obj : sources) {
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
index bdb0e3467..b8a020ea6 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
@@ -538,7 +538,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
@Override
public IResource[] getMappedResources() throws CoreException {
List<String> paths = getAttribute(ATTR_MAPPED_RESOURCE_PATHS, (List<String>) null);
- if (paths == null || paths.size() == 0) {
+ if (paths == null || paths.isEmpty()) {
return null;
}
List<String> types = getAttribute(ATTR_MAPPED_RESOURCE_TYPES, (List<String>) null);
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java
index 1fbfb46ba..e787aab35 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java
@@ -147,7 +147,7 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
for (int i=0; i<memBlocks.length; i++) {
memoryBlocks.remove(memBlocks[i]);
// remove listener after the last memory block has been removed
- if (memoryBlocks.size() == 0) {
+ if (memoryBlocks.isEmpty()) {
DebugPlugin.getDefault().removeDebugEventListener(this);
}
if (memBlocks[i] instanceof IMemoryBlockExtension) {
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java
index d06aa4ee6..c87f63bcf 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/groups/GroupLaunch.java
@@ -98,7 +98,7 @@ public class GroupLaunch extends Launch implements ILaunchesListener2 {
}
synchronized (subLaunches) {
- if (subLaunches.size() == 0) {
+ if (subLaunches.isEmpty()) {
return fLaunched; // in case we're done launching and there is
// nobody -> terminated
}
@@ -123,7 +123,7 @@ public class GroupLaunch extends Launch implements ILaunchesListener2 {
@Override
public boolean canTerminate() {
synchronized (subLaunches) {
- if (subLaunches.size() == 0) {
+ if (subLaunches.isEmpty()) {
return false;
}
@@ -190,7 +190,7 @@ public class GroupLaunch extends Launch implements ILaunchesListener2 {
// accessible
if (subLaunches.remove(launch) != null) {
// terminate ourselves if this is the last sub launch
- if (subLaunches.size() == 0 && fLaunched) {
+ if (subLaunches.isEmpty() && fLaunched) {
fTerminated = true;
fireTerminate();
}
diff --git a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java
index cfcb6ac0e..685e967cb 100644
--- a/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java
+++ b/org.eclipse.debug.examples.memory/src/org/eclipse/debug/examples/internal/memory/core/SampleMemoryBlock.java
@@ -140,7 +140,7 @@ public class SampleMemoryBlock extends DebugElement implements IMemoryBlockExten
fConnections.remove(object);
}
- if (fConnections.size() == 0) {
+ if (fConnections.isEmpty()) {
disable();
}
}
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java
index 04939c292..3a4a60d8a 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/TestModelUpdatesListener.java
@@ -561,7 +561,7 @@ public class TestModelUpdatesListener implements IViewerUpdateListener, ILabelUp
}
}
if ((flags & MODEL_PROXIES_INSTALLED) != 0) {
- if (fProxyModels.size() != 0) {
+ if (!fProxyModels.isEmpty()) {
return false;
}
}
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);
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java
index 85c9f29a4..d1241ad51 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java
@@ -1089,7 +1089,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
arguments.remove(COMMAND_ENABLED);
}
List<ILaunchConfigurationType> externalToolTypes = getConfigurationTypes(IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY);
- if (externalToolTypes.size() == 0) {
+ if (externalToolTypes.isEmpty()) {
return null;
}
ILaunchConfigurationType type= externalToolTypes.get(0);

Back to the top