diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbPinProvider.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbPinProvider.java index c7cc9a11f1b..e666949c88e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbPinProvider.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbPinProvider.java @@ -168,9 +168,9 @@ public class GdbPinProvider implements IPinProvider { if (data != null) { String name = data.getName(); String id = data.getId(); - if (name != null && name.length() > 0) + if (name != null && !name.isEmpty()) label = name; - else if (id != null && id.length() > 0) + else if (id != null && !id.isEmpty()) label = id; } return label; @@ -184,7 +184,7 @@ public class GdbPinProvider implements IPinProvider { // get the execution (thread) context label if (execDmc != null) { int threadId = execDmc.getThreadId(); - label += label.length() > 0 ? ": " : ""; //$NON-NLS-1$//$NON-NLS-2$ + label += !label.isEmpty() ? ": " : ""; //$NON-NLS-1$//$NON-NLS-2$ label += "Thread [" + Integer.toString(threadId) + "]"; //$NON-NLS-1$//$NON-NLS-2$ } return label; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java index 70960a83545..53f52f945ee 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java @@ -469,7 +469,7 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne } // Check that we have a process to attach to - if (procList.size() > 0) { + if (!procList.isEmpty()) { // Check that we can actually attach to the process. // This is because some backends may not support multi-process. diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbStartTracingCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbStartTracingCommand.java index 9de35ffeec3..86f153e40a6 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbStartTracingCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbStartTracingCommand.java @@ -69,7 +69,7 @@ public class GdbStartTracingCommand extends AbstractDebugCommand implements ISta final IGDBTraceControl traceControl = fTracker.getService(IGDBTraceControl.class); if (traceControl != null) { String user = System.getProperty("user.name"); //$NON-NLS-1$ - if (user != null && user.length() > 0 && traceControl instanceof IGDBTraceControl2) { + if (user != null && !user.isEmpty() && traceControl instanceof IGDBTraceControl2) { ((IGDBTraceControl2)traceControl).setTraceUser(dmc, user, new ImmediateRequestMonitor() { @Override protected void handleCompleted() { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CArgumentsTab.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CArgumentsTab.java index a9ef92021ed..c42dbd7b5f5 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CArgumentsTab.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/CArgumentsTab.java @@ -208,7 +208,7 @@ public class CArgumentsTab extends CLaunchConfigurationTab { String content = text.getText().trim(); // bug #131513 - eliminate Windows \r line delimiter content = content.replaceAll("\r\n", "\n"); //$NON-NLS-1$//$NON-NLS-2$ - if (content.length() > 0) { + if (!content.isEmpty()) { return content; } return null; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/SolibSearchPathBlock.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/SolibSearchPathBlock.java index 5416c00eb82..df237dc0f64 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/SolibSearchPathBlock.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/SolibSearchPathBlock.java @@ -298,7 +298,7 @@ public class SolibSearchPathBlock extends Observable implements IMILaunchConfigu String projectName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null); if (projectName != null) { projectName = projectName.trim(); - if (projectName.length() > 0) { + if (!projectName.isEmpty()) { project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/WorkingDirectoryBlock.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/WorkingDirectoryBlock.java index 50cdce58464..f62ef04c272 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/WorkingDirectoryBlock.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/launching/WorkingDirectoryBlock.java @@ -212,7 +212,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab { */ protected IContainer getContainer() { String path = fWorkingDirText.getText().trim(); - if (path.length() > 0) { + if (!path.isEmpty()) { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IResource res = root.findMember(path); if (res instanceof IContainer) { @@ -288,7 +288,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab { setErrorMessage(e.getMessage()); return false; } - } else if (workingDirPath.length() > 0) { + } else if (!workingDirPath.isEmpty()) { IContainer container = getContainer(); if (container == null) { File dir = new File(workingDirPath); @@ -358,7 +358,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab { */ protected String getAttributeValueFrom(Text text) { String content = text.getText().trim(); - if (content.length() > 0) { + if (!content.isEmpty()) { return content; } return null; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSResourcesView.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSResourcesView.java index 2ee982707b6..16beeeaff81 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSResourcesView.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/osview/OSResourcesView.java @@ -230,7 +230,7 @@ public class OSResourcesView extends ViewPart implements DsfSession.SessionEnded fWrongType = false; if (s instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) s; - if (ss.size() > 0) { + if (!ss.isEmpty()) { @SuppressWarnings("rawtypes") Iterator i = ss.iterator(); context = getCommandControlContext(i.next()); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepointactions/TracepointActionDialog.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepointactions/TracepointActionDialog.java index 978d2feb1de..2ea7fef2ad5 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepointactions/TracepointActionDialog.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepointactions/TracepointActionDialog.java @@ -157,7 +157,7 @@ public class TracepointActionDialog extends Dialog { actionPages = new IBreakpointActionPage[TRACEPOINT_ACTIONS_COUNT]; actionComposites = new Composite[TRACEPOINT_ACTIONS_COUNT]; - if (tracepointActions.size() > 0) { + if (!tracepointActions.isEmpty()) { String lastTypeName = GdbUIPlugin.getDefault().getPreferenceStore().getString(TRACEPOINT_ACTION_DIALOG_LAST_SELECTED); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceVarDetailsDialog.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceVarDetailsDialog.java index fd28fc38cfe..9ec1eb9137c 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceVarDetailsDialog.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceVarDetailsDialog.java @@ -306,7 +306,7 @@ public final class TraceVarDetailsDialog extends Dialog { protected void handleCreate() { String name = nameInput.getText(); - if (name != null && name.length() > 0) { + if (name != null && !name.isEmpty()) { String value = valueInput.getText(); if (value != null && value.length() == 0) { value = null; // No value specified diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/GDBTypeParser.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/GDBTypeParser.java index bbffab43533..ed2e20fd69f 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/GDBTypeParser.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/GDBTypeParser.java @@ -439,7 +439,7 @@ public class GDBTypeParser { if (tokenType == '(') { dcl(); - if (tokenType != ')' /*&& name.length() > 0*/) { + if (tokenType != ')' /*&& !name.isEmpty()*/) { // Do we throw an exception on unterminated parentheses // It should have been handle by getToken() return; @@ -451,7 +451,7 @@ public class GDBTypeParser { insertingChild(GDBType.FUNCTION); } else if (tokenType == BRACKETS) { int len = 0; - if (token.length() > 0) { + if (!token.isEmpty()) { try { len = Integer.parseInt(token); } catch (NumberFormatException e) { @@ -470,7 +470,7 @@ public class GDBTypeParser { insertingChild(GDBType.FUNCTION); } else { /* BRACKETS */ int len = 0; - if (token.length() > 0) { + if (!token.isEmpty()) { try { len = Integer.parseInt(token); } catch (NumberFormatException e) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlock.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlock.java index d8e10e93540..7cd8284356a 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlock.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/internal/memory/GdbMemoryBlock.java @@ -51,8 +51,8 @@ public class GdbMemoryBlock extends DsfMemoryBlock implements IMemorySpaceAwareM String modelId, String expression, BigInteger address, int word_size, long length, String memorySpaceID) { super(retrieval, context, modelId, expression, address, word_size, length); - fMemorySpaceID = (memorySpaceID != null && memorySpaceID.length() > 0) ? memorySpaceID : null; - assert memorySpaceID == null || memorySpaceID.length() > 0; // callers shouldn't be passing in an empty string + fMemorySpaceID = (memorySpaceID != null && !memorySpaceID.isEmpty()) ? memorySpaceID : null; + assert memorySpaceID == null || !memorySpaceID.isEmpty(); // callers shouldn't be passing in an empty string //TODO: remove the memorySpaceID parameter from this method //after making sure it's not used in earlier implementations @@ -138,7 +138,7 @@ public class GdbMemoryBlock extends DsfMemoryBlock implements IMemorySpaceAwareM @Override public String getExpression() { if (fMemorySpaceID != null) { - assert fMemorySpaceID.length() > 0; + assert !fMemorySpaceID.isEmpty(); GdbMemoryBlockRetrieval retrieval = (GdbMemoryBlockRetrieval)getMemoryBlockRetrieval(); return retrieval.encodeAddress(super.getExpression(), fMemorySpaceID); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java index eefbc6f7dd9..36a56920fbd 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java @@ -336,7 +336,7 @@ public class FinalLaunchSequence extends ReflectionSequence { try { String gdbinitFile = fGDBBackend.getGDBInitFile(); - if (gdbinitFile != null && gdbinitFile.length() > 0) { + if (gdbinitFile != null && !gdbinitFile.isEmpty()) { String projectName = (String) fAttributes.get(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME); final String expandedGDBInitFile = new DebugStringVariableSubstitutor(projectName).performStringSubstitution(gdbinitFile); @@ -439,7 +439,7 @@ public class FinalLaunchSequence extends ReflectionSequence { try { List p = fGDBBackend.getSharedLibraryPaths(); - if (p.size() > 0) { + if (!p.isEmpty()) { String[] paths = p.toArray(new String[p.size()]); fCommandControl.queueCommand( fCommandFactory.createMIGDBSetSolibSearchPath(fCommandControl.getContext(), paths), diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java index a57d392adba..318d533ab0d 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/LaunchUtils.java @@ -86,7 +86,7 @@ public class LaunchUtils { return null; } ICProject cproject = getCProject(configuration); - if (cproject == null && name.length() > 0) { + if (cproject == null && !name.isEmpty()) { IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(name); if (!proj.exists()) { abort(LaunchMessages.getFormattedString("AbstractCLaunchDelegate.Project_NAME_does_not_exist", name), null, //$NON-NLS-1$ @@ -203,7 +203,7 @@ public class LaunchUtils { String projectName = getProjectName(configuration); if (projectName != null) { projectName = projectName.trim(); - if (projectName.length() > 0) { + if (!projectName.isEmpty()) { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); ICProject cProject = CCorePlugin.getDefault().getCoreModel().create(project); if (cProject != null && cProject.exists()) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/DebugNewProcessSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/DebugNewProcessSequence.java index 8bac76f5682..4d55769299e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/DebugNewProcessSequence.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/DebugNewProcessSequence.java @@ -168,7 +168,7 @@ public class DebugNewProcessSequence extends ReflectionSequence { return; } - if (clear == true || properties.size() > 0) { + if (clear == true || !properties.isEmpty()) { // here we need to pass the proper container context fCommandControl.setEnvironment(properties, clear, rm); } else { @@ -186,7 +186,7 @@ public class DebugNewProcessSequence extends ReflectionSequence { IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP, IGDBLaunchConfigurationConstants.DEBUGGER_USE_SOLIB_SYMBOLS_FOR_APP_DEFAULT); - if (!noFileCommand && fBinaryName != null && fBinaryName.length() > 0) { + if (!noFileCommand && fBinaryName != null && !fBinaryName.isEmpty()) { fCommandControl.queueCommand( fCommandFactory.createMIFileExecAndSymbols(getContainerContext(), fBinaryName), new ImmediateDataRequestMonitor(rm)); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java index f72a792d32b..572bb7f35d2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBBackend.java @@ -249,7 +249,7 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend, IMIBa if (location != null) { String expandedLocation = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(location); - if (expandedLocation.length() > 0) { + if (!expandedLocation.isEmpty()) { path = new Path(expandedLocation); } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java index 6ffd8373a01..0d654f5159d 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_0.java @@ -784,7 +784,7 @@ public class GDBProcesses_7_0 extends AbstractDsfService // append thread details (if any) to the thread ID // as for GDB 6.x with CLIInfoThreadsInfo#getOsId() final String details = thread.getDetails(); - if (details != null && details.length() > 0) { + if (details != null && !details.isEmpty()) { if (!id.isEmpty()) id += " "; //$NON-NLS-1$ id += "(" + details + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java index 01c7c99e70a..886f960ebd0 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBProcesses_7_1.java @@ -208,7 +208,7 @@ public class GDBProcesses_7_1 extends GDBProcesses_7_0 { // append thread details (if any) to the thread ID // as for GDB 6.x with CLIInfoThreadsInfo#getOsId() final String details = thread.getDetails(); - if (details != null && details.length() > 0) { + if (details != null && !details.isEmpty()) { if (!id.isEmpty()) id += " "; //$NON-NLS-1$ id += "(" + details + ")"; //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java index cd02d4df23c..76eecbad55e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBRunControl_7_0_NS.java @@ -1395,7 +1395,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo protected void handleSuccess() { fOngoingOperation = false; - if (fOperationsPending.size() > 0) { + if (!fOperationsPending.isEmpty()) { // Darn, more operations came in. Trigger their processing // by calling executeWithTargetAvailable() on the last one TargetAvailableOperationInfo info = fOperationsPending.removeLast(); @@ -1411,7 +1411,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo fOngoingOperation = false; // Complete each rm of the cancelled operations - while (fOperationsPending.size() > 0) { + while (!fOperationsPending.isEmpty()) { RequestMonitor rm = fOperationsPending.poll().rm; rm.setStatus(getStatus()); rm.done(); @@ -1582,7 +1582,7 @@ public class GDBRunControl_7_0_NS extends AbstractDsfService implements IMIRunCo // All pending operations are independent of each other so we can // run them concurrently. - while (fOperationsPending.size() > 0) { + while (!fOperationsPending.isEmpty()) { executeSteps(fOperationsPending.poll()); } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java index d8c45ee7d64..1c4e4abc652 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpoints.java @@ -613,7 +613,7 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints, I } else if (!function.equals(NULL_STRING)) { // function location without source location = function; - } else if (location.length() > 0) { + } else if (!location.isEmpty()) { // address location if (Character.isDigit(location.charAt(0))) { // numeric address needs '*' prefix @@ -749,7 +749,7 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints, I boolean isRead = (Boolean) getProperty(attributes, READ, false); boolean isWrite = (Boolean) getProperty(attributes, WRITE, false); - if (expression.length() > 0 && Character.isDigit(expression.charAt(0))) { + if (!expression.isEmpty() && Character.isDigit(expression.charAt(0))) { // If expression is an address, we need the '*' prefix. expression = "*" + expression; //$NON-NLS-1$ } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsSynchronizer.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsSynchronizer.java index a29da1d37f0..d0aa81b3f35 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsSynchronizer.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsSynchronizer.java @@ -345,7 +345,7 @@ public class MIBreakpointsSynchronizer extends AbstractDsfService implements IMI && ((IMIExecutionDMContext)c).getThreadId() != threadId) list.add(c); } - if (list.size() > 0) { + if (!list.isEmpty()) { bpExtension.setThreadFilters(list.toArray(new IExecutionDMContext[list.size()])); } else { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java index 8f1fda97c35..456a9b42e07 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIExpressions.java @@ -1773,7 +1773,7 @@ public class MIExpressions extends AbstractDsfService implements IMIExpressions, int castingIndex = castInfo.getArrayStartIndex(); // cast to type - if (castType != null && castType.length() > 0) { + if (castType != null && !castType.isEmpty()) { StringBuffer buffer = new StringBuffer(); buffer.append('(').append(castType).append(')'); buffer.append('(').append(castExpression).append(')'); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java index cf7de936f0f..423149d1fb8 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRegisters.java @@ -481,7 +481,7 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach List regDmcList = new ArrayList( regNames.length ); int regNo = 0; for (String regName : regNames) { - if(regName != null && regName.length() > 0) { + if(regName != null && !regName.isEmpty()) { if(frameDmc != null) regDmcList.add(new MIRegisterDMC(this, groupDmc, frameDmc, regNo, regName)); else diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java index e35d1ccd155..429184bf564 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIRunControl.java @@ -1202,7 +1202,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I protected void handleSuccess() { fOngoingOperation = false; - if (fOperationsPending.size() > 0) { + if (!fOperationsPending.isEmpty()) { // Darn, more operations came in. Trigger their processing // by calling executeWithTargetAvailable() on the last one TargetAvailableOperationInfo info = fOperationsPending.removeLast(); @@ -1218,7 +1218,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I fOngoingOperation = false; // Complete each rm of the cancelled operations - while (fOperationsPending.size() > 0) { + while (!fOperationsPending.isEmpty()) { RequestMonitor rm = fOperationsPending.poll().rm; rm.setStatus(getStatus()); rm.done(); @@ -1367,7 +1367,7 @@ public class MIRunControl extends AbstractDsfService implements IMIRunControl, I // All pending operations are independent of each other so we can // run them concurrently. - while (fOperationsPending.size() > 0) { + while (!fOperationsPending.isEmpty()) { executeSteps(fOperationsPending.poll()); } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java index fd39beea6d6..a8cb20028c4 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java @@ -760,7 +760,7 @@ public class MIVariableManager implements ICommandControl { private void unlock() { locked = false; - while (operationsPending.size() > 0) { + while (!operationsPending.isEmpty()) { operationsPending.poll().done(); } } @@ -777,7 +777,7 @@ public class MIVariableManager implements ICommandControl { // can tell any pending monitors that updates are done if (success) { currentState = STATE_READY; - while (updatesPending.size() > 0) { + while (!updatesPending.isEmpty()) { DataRequestMonitor rm = updatesPending.poll(); // Nothing to be re-created rm.setData(false); @@ -787,7 +787,7 @@ public class MIVariableManager implements ICommandControl { currentState = STATE_CREATION_FAILED; // Creation failed, inform anyone waiting. - while (updatesPending.size() > 0) { + while (!updatesPending.isEmpty()) { RequestMonitor rm = updatesPending.poll(); rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_HANDLE, "Unable to create variable object", null)); //$NON-NLS-1$ @@ -828,7 +828,7 @@ public class MIVariableManager implements ICommandControl { // All the other request monitors must be notified but must // not re-create the object, even if it is out-of-scope - while (updatesPending.size() > 0) { + while (!updatesPending.isEmpty()) { DataRequestMonitor pendingRm = updatesPending.poll(); pendingRm.setData(false); pendingRm.done(); @@ -837,7 +837,7 @@ public class MIVariableManager implements ICommandControl { rm.setStatus(getStatus()); rm.done(); - while (updatesPending.size() > 0) { + while (!updatesPending.isEmpty()) { DataRequestMonitor pendingRm = updatesPending.poll(); pendingRm.setStatus(getStatus()); pendingRm.done(); @@ -1274,7 +1274,7 @@ public class MIVariableManager implements ICommandControl { rm.setData(getData()); rm.done(); - while (fetchChildrenPending.size() > 0) { + while (!fetchChildrenPending.isEmpty()) { DataRequestMonitor pendingRm = fetchChildrenPending.poll(); pendingRm.setData(getData()); pendingRm.done(); @@ -1283,7 +1283,7 @@ public class MIVariableManager implements ICommandControl { rm.setStatus(getStatus()); rm.done(); - while (fetchChildrenPending.size() > 0) { + while (!fetchChildrenPending.isEmpty()) { DataRequestMonitor pendingRm = fetchChildrenPending.poll(); pendingRm.setStatus(getStatus()); pendingRm.done(); @@ -2285,7 +2285,7 @@ public class MIVariableManager implements ICommandControl { rm.setData(true); rm.done(); - while (updatesPending.size() > 0) { + while (!updatesPending.isEmpty()) { DataRequestMonitor pendingRm = updatesPending.poll(); pendingRm.setData(false); pendingRm.done(); @@ -2309,7 +2309,7 @@ public class MIVariableManager implements ICommandControl { } rm.done(); - while (updatesPending.size() > 0) { + while (!updatesPending.isEmpty()) { DataRequestMonitor pendingRm = updatesPending.poll(); if (isSuccess()) { pendingRm.setData(false); @@ -2328,7 +2328,7 @@ public class MIVariableManager implements ICommandControl { rm.setData(false); rm.done(); - while (updatesPending.size() > 0) { + while (!updatesPending.isEmpty()) { DataRequestMonitor pendingRm = updatesPending.poll(); pendingRm.setStatus(getStatus()); pendingRm.done(); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java index 310d86e6082..9e20330e165 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractMIControl.java @@ -360,7 +360,7 @@ public abstract class AbstractMIControl extends AbstractDsfService } private void processNextQueuedCommand() { - if (fCommandQueue.size() > 0) { + if (!fCommandQueue.isEmpty()) { final CommandHandle handle = fCommandQueue.remove(0); if (handle != null) { processCommandSent(handle); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIBreakInsert.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIBreakInsert.java index 0ab83a75855..2de7b9f379e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIBreakInsert.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIBreakInsert.java @@ -106,7 +106,7 @@ public class MIBreakInsert extends MICommand if (isHardware) { i++; } - if (condition != null && condition.length() > 0) { + if (condition != null && !condition.isEmpty()) { i += 2; } if (ignoreCount > 0) { @@ -138,7 +138,7 @@ public class MIBreakInsert extends MICommand opts[i] = "-h"; //$NON-NLS-1$ i++; } - if (condition != null && condition.length() > 0) { + if (condition != null && !condition.isEmpty()) { opts[i] = "-c"; //$NON-NLS-1$ i++; opts[i] = condition; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java index 28e9a92d2c9..7b23078af56 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MICommand.java @@ -166,11 +166,11 @@ public class MICommand implements ICommand { } String opt = optionsToString(); - if (opt.length() > 0) { + if (!opt.isEmpty()) { command.append(' ').append(opt); } String p = parametersToString(); - if (p.length() > 0) { + if (!p.isEmpty()) { command.append(' ').append(p); } command.append('\n'); @@ -212,7 +212,7 @@ public class MICommand implements ICommand { protected String optionsToString() { StringBuffer sb = new StringBuffer(); - if (fOptions != null && fOptions.size() > 0) { + if (fOptions != null && !fOptions.isEmpty()) { for (Adjustable option : fOptions) { sb.append(option.getAdjustedValue()); } @@ -223,7 +223,7 @@ public class MICommand implements ICommand { protected String parametersToString() { String[] options = getOptions(); StringBuffer buffer = new StringBuffer(); - if (fParameters != null && fParameters.size() > 0) { + if (fParameters != null && !fParameters.isEmpty()) { // According to GDB/MI spec // Add a "--" separator if any parameters start with "-" if (options != null && options.length > 0) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDPrintfInsert.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDPrintfInsert.java index 87a21fc161f..60a26f475a4 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDPrintfInsert.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIDPrintfInsert.java @@ -71,7 +71,7 @@ public class MIDPrintfInsert extends MICommand if (isTemporary) { i++; } - if (condition != null && condition.length() > 0) { + if (condition != null && !condition.isEmpty()) { i += 2; } if (ignoreCount > 0) { @@ -95,7 +95,7 @@ public class MIDPrintfInsert extends MICommand opts[i] = "-t"; //$NON-NLS-1$ i++; } - if (condition != null && condition.length() > 0) { + if (condition != null && !condition.isEmpty()) { opts[i] = "-c"; //$NON-NLS-1$ i++; opts[i] = condition; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoProgramInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoProgramInfo.java index ee04c794754..28823a77ef1 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoProgramInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoProgramInfo.java @@ -57,7 +57,7 @@ public class CLIInfoProgramInfo extends MIInfo { // Program stopped at 0x4012f5. // It stopped at a breakpoint that has since been deleted. - if (str != null && str.length() > 0) { + if (str != null && !str.isEmpty()) { str = str.replace('.', ' ').trim(); if (str.startsWith("Using")) { //$NON-NLS-1$ StringTokenizer st = new StringTokenizer(str); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoSharedLibraryInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoSharedLibraryInfo.java index 9e7d13fe728..d8936f4f60a 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoSharedLibraryInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoSharedLibraryInfo.java @@ -88,7 +88,7 @@ public class CLIInfoSharedLibraryInfo extends MIInfo { } void parseShared(String str, List aList) { - if (str.length() > 0) { + if (!str.isEmpty()) { // Parsing pattern of type ~"0x40000970 0x4001331f Yes /lib/ld-linux.so.2\n" Pattern pattern = Pattern.compile("(0x.*)(0x.*)(Yes|No)(\\s*)(.*)", Pattern.MULTILINE); //$NON-NLS-1$ Matcher matcher = pattern.matcher(str); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoThreadsInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoThreadsInfo.java index 82168581e0f..8d9d36a4f0f 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoThreadsInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIInfoThreadsInfo.java @@ -141,7 +141,7 @@ public class CLIInfoThreadsInfo extends MIInfo { // The original code favored the format in example A and so we will // continue to give it precedence. The newly added support for formats // B and C will have lower precedence. - if(str.length() > 0 ){ + if(!str.isEmpty() ){ Matcher matcher = RESULT_PATTERN_LWP.matcher(str); // example A boolean isCurrentThread = false; if (matcher.find()) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIThreadInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIThreadInfo.java index 1cd2a27ec01..1b3060e76f2 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIThreadInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLIThreadInfo.java @@ -51,7 +51,7 @@ public class CLIThreadInfo extends MIInfo { protected void parseThreadInfo(String str) { // Fetch the OS ThreadId & Find the current thread - if(str.length() > 0 ){ + if(!str.isEmpty() ){ Pattern pattern = Pattern.compile("Current thread is (\\d+)", Pattern.MULTILINE); //$NON-NLS-1$ Matcher matcher = pattern.matcher(str); if (matcher.find()) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLITraceInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLITraceInfo.java index 387b821df9e..a07e510f66d 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLITraceInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLITraceInfo.java @@ -42,7 +42,7 @@ public class CLITraceInfo extends MIInfo { if (oobs[i] instanceof MIConsoleStreamOutput) { MIStreamRecord cons = (MIStreamRecord) oobs[i]; String str = cons.getString().trim(); - if(str.length() > 0 ){ + if(!str.isEmpty() ){ Pattern pattern = Pattern.compile("^Tracepoint\\s(\\d+)", Pattern.MULTILINE); //$NON-NLS-1$ Matcher matcher = pattern.matcher(str); if (matcher.find()) { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterNamesInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterNamesInfo.java index ad5633a939d..4491c8c7d6d 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterNamesInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIDataListRegisterNamesInfo.java @@ -67,7 +67,7 @@ public class MIDataListRegisterNamesInfo extends MIInfo { /* this cannot filter nulls because index is critical in retreival * and index is assigned in the layers above. The MI spec allows * empty returns, for some register names. */ - if (str != null && str.length() > 0) { + if (str != null && !str.isEmpty()) { realNameCount++; aList.add(str); } else { diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java index e5d302512be..7a7b607624c 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIListThreadGroupsInfo.java @@ -245,7 +245,7 @@ public class MIListThreadGroupsInfo extends MIInfo { // The brackets indicate that the startup parameters are not available // We handle this case by removing the brackets and the core indicator // since GDB already tells us the core separately. - if (desc.length() > 0 && desc.charAt(0) == '[') { + if (!desc.isEmpty() && desc.charAt(0) == '[') { // Remove brackets name = desc.substring(1, desc.length()-1); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIResult.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIResult.java index 17d9523a1b1..bb82e2b4b65 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIResult.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/MIResult.java @@ -42,7 +42,7 @@ public class MIResult { if (value != null) { String v = value.toString(); buffer.append('='); - if (v.length() > 0 && (v.charAt(0) == '[' || v.charAt(0) =='{')) { + if (!v.isEmpty() && (v.charAt(0) == '[' || v.charAt(0) =='{')) { buffer.append(v); } else { buffer.append("\"" + value.toString() + "\""); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java index 64f4ef686b7..939da161d57 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/CSourceNotFoundDescriptionFactory.java @@ -105,7 +105,7 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory { String file = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FILE); String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION); String module = (String)properties.get(ILaunchVMConstants.PROP_FRAME_MODULE); - if (line != null && line >= 0 && file != null && file.length() > 0) + if (line != null && line >= 0 && file != null && !file.isEmpty()) { if (function != null && function.contains(")")) //$NON-NLS-1$ formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__text_format; @@ -119,7 +119,7 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory { ILaunchVMConstants.PROP_FRAME_COLUMN, ILaunchVMConstants.PROP_FRAME_MODULE}; } - else if (function != null && function.length() > 0 && module != null && module.length() > 0) + else if (function != null && !function.isEmpty() && module != null && !module.isEmpty()) { if (function.contains(")")) //$NON-NLS-1$ formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_line__text_format; @@ -130,14 +130,14 @@ public class CSourceNotFoundDescriptionFactory implements IAdapterFactory { ILaunchVMConstants.PROP_FRAME_FUNCTION, ILaunchVMConstants.PROP_FRAME_MODULE}; } - else if (module != null && module.length() > 0) + else if (module != null && !module.isEmpty()) { formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_function__text_format; propertyNames = new String[] { ILaunchVMConstants.PROP_FRAME_ADDRESS, ILaunchVMConstants.PROP_FRAME_MODULE}; } - else if (function != null && function.length() > 0) + else if (function != null && !function.isEmpty()) { if (function.contains(")")) //$NON-NLS-1$ formatString = MessagesForLaunchVM.StackFramesVMNode_No_columns__No_module__text_format; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java index d513562489d..2b25648691d 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java @@ -716,7 +716,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements String compilationPath= null; // insert symbol label final String functionName= instruction.getFuntionName(); - if (functionName != null && functionName.length() > 0 && instruction.getOffset() == 0) { + if (functionName != null && !functionName.isEmpty() && instruction.getOffset() == 0) { p = fCallback.getDocument().insertLabel(p, address, functionName, showSymbols && (!hasSource || showDisassembly)); } // determine instruction byte length @@ -735,7 +735,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements } final String functionOffset; // Renamed from opCode to avoid confusion // insert function name+offset instead of opcode bytes - if (functionName != null && functionName.length() > 0) { + if (functionName != null && !functionName.isEmpty()) { functionOffset= functionName + '+' + instruction.getOffset(); } else { functionOffset= ""; //$NON-NLS-1$ @@ -843,7 +843,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements } // insert symbol label final String functionName= instruction.getFuntionName(); - if (functionName != null && functionName.length() > 0 && instruction.getOffset() == 0) { + if (functionName != null && !functionName.isEmpty() && instruction.getOffset() == 0) { p = fCallback.getDocument().insertLabel(p, address, functionName, showSymbols && (!hasSource || showDisassembly)); } // determine instruction byte length @@ -875,7 +875,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements } final String funcOffset; // insert function name+offset instead of opcode bytes - if (functionName != null && functionName.length() > 0) { + if (functionName != null && !functionName.isEmpty()) { funcOffset= functionName + '+' + instruction.getOffset(); } else { funcOffset= ""; //$NON-NLS-1$ diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java index fa8d5aa7479..8ac52f3bd94 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java @@ -2195,7 +2195,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem bpList.add(bp); } } - if (bpList.size() > 0) { + if (!bpList.isEmpty()) { return bpList.toArray(new IBreakpoint[bpList.size()]); } } @@ -2422,7 +2422,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem return; } AddressRangePosition first = null; - if (fPCHistory.size() > 0) { + if (!fPCHistory.isEmpty()) { first = fPCHistory.getFirst(); if (first.fAddressOffset == pcPos.fAddressOffset) { if (first.offset != pcPos.offset || first.length != pcPos.length) { @@ -2898,7 +2898,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem } } } - if (styleRanges.size() > 0) { + if (!styleRanges.isEmpty()) { for (Iterator iter = styleRanges.iterator(); iter.hasNext();) { textPresentation.addStyleRange(iter.next()); } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java index 730db8b7991..32725716481 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/BreakpointsAnnotationModel.java @@ -241,7 +241,7 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple if (string.startsWith("0x")) { //$NON-NLS-1$ return new BigInteger(string.substring(2), 16); } - if (string.length() > 0) { + if (!string.isEmpty()) { return new BigInteger(string); } } catch (NumberFormatException nfe) { @@ -263,7 +263,7 @@ public class BreakpointsAnnotationModel extends DisassemblyAnnotationModel imple */ @Override public void documentChanged(DocumentEvent event) { - if (fCatchup == null && event.fText != null && event.fText.length() > 0) { + if (fCatchup == null && event.fText != null && !event.fText.isEmpty()) { fCatchup= new Runnable() { @Override public void run() { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java index 791b58d2875..6058144ff69 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java @@ -1052,7 +1052,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu buf.append(':'); buf.append(' '); } - if (fShowFunctionOffset && functionOffset != null && functionOffset.length() > 0) { + if (fShowFunctionOffset && functionOffset != null && !functionOffset.isEmpty()) { buf.append(functionOffset); int tab = 16; if (functionOffset.length() >= 16) { @@ -1215,7 +1215,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu // System.out.println("insertSource at "+getAddressText(pos.fAddressOffset)); // System.out.println(source); String sourceLines = source; - if (source.length() > 0 && sourceLines.charAt(source.length() - 1) != '\n') { + if (!source.isEmpty() && sourceLines.charAt(source.length() - 1) != '\n') { sourceLines += "\n"; //$NON-NLS-1$ } try { @@ -1413,7 +1413,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu public boolean hasInvalidSourcePositions() { assert isGuiThread(); - return fInvalidSource.size() > 0; + return !fInvalidSource.isEmpty(); } public void invalidateDisassemblyWithSource(boolean removeDisassembly) { diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDRun.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDRun.java index 8316ccd0a7b..91f51513fb0 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDRun.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDRun.java @@ -35,7 +35,7 @@ public class REDRun implements CharSequence { /** * @pre rider != null * @pre style != null - * @pre str.length() > 0 + * @pre !str.isEmpty() */ public REDRun(IFileRider rider, String str) throws IOException { fRider = rider; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java index e690a1ababe..f55c8a8c52e 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/AbstractDsfDebugTextHover.java @@ -218,7 +218,7 @@ abstract public class AbstractDsfDebugTextHover extends AbstractDebugTextHover i // see also getHoverControlCreator() final String text; text= getExpressionText(textViewer, hoverRegion); - if (text != null && text.length() > 0) { + if (text != null && !text.isEmpty()) { final IFrameDMContext frameDmc = getFrame(); if (frameDmc != null) { final DsfSession dsfSession = DsfSession.getSession(frameDmc.getSessionId()); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java index dd1a4c9b66f..3894b020c9e 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java @@ -173,7 +173,7 @@ public class StackFramesVMNode extends AbstractDMVMNode Integer line = (Integer)properties.get(ILaunchVMConstants.PROP_FRAME_LINE); String file = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FILE); String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION); - return line != null && line >= 0 && file != null && file.length() > 0 && + return line != null && line >= 0 && file != null && !file.isEmpty() && function != null && function.contains(")"); //$NON-NLS-1$ }; }, @@ -192,7 +192,7 @@ public class StackFramesVMNode extends AbstractDMVMNode Integer line = (Integer)properties.get(ILaunchVMConstants.PROP_FRAME_LINE); String file = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FILE); String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION); - return line != null && line >= 0 && file != null && file.length() > 0 && + return line != null && line >= 0 && file != null && !file.isEmpty() && (function == null || !function.contains(")")); //$NON-NLS-1$ }; }, @@ -207,8 +207,8 @@ public class StackFramesVMNode extends AbstractDMVMNode public boolean isEnabled(IStatus status, java.util.Map properties) { String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION); String module = (String)properties.get(ILaunchVMConstants.PROP_FRAME_MODULE); - return function != null && function.length() > 0 && function.contains(")") && //$NON-NLS-1$ - module != null && module.length() > 0; + return function != null && !function.isEmpty() && function.contains(")") && //$NON-NLS-1$ + module != null && !module.isEmpty(); }; }, new LabelText( @@ -222,8 +222,8 @@ public class StackFramesVMNode extends AbstractDMVMNode public boolean isEnabled(IStatus status, java.util.Map properties) { String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION); String module = (String)properties.get(ILaunchVMConstants.PROP_FRAME_MODULE); - return function != null && function.length() > 0 && !function.contains(")") && //$NON-NLS-1$ - module != null && module.length() > 0; + return function != null && !function.isEmpty() && !function.contains(")") && //$NON-NLS-1$ + module != null && !module.isEmpty(); }; }, new LabelText( @@ -235,7 +235,7 @@ public class StackFramesVMNode extends AbstractDMVMNode @Override public boolean isEnabled(IStatus status, java.util.Map properties) { String module = (String)properties.get(ILaunchVMConstants.PROP_FRAME_MODULE); - return module != null && module.length() > 0; + return module != null && !module.isEmpty(); }; }, new LabelText( @@ -247,7 +247,7 @@ public class StackFramesVMNode extends AbstractDMVMNode @Override public boolean isEnabled(IStatus status, java.util.Map properties) { String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION); - return function != null && function.length() > 0 && function.contains(")"); //$NON-NLS-1$ + return function != null && !function.isEmpty() && function.contains(")"); //$NON-NLS-1$ }; }, new LabelText( @@ -259,7 +259,7 @@ public class StackFramesVMNode extends AbstractDMVMNode @Override public boolean isEnabled(IStatus status, java.util.Map properties) { String function = (String)properties.get(ILaunchVMConstants.PROP_FRAME_FUNCTION); - return function != null && function.length() > 0 && !function.contains(")"); //$NON-NLS-1$ + return function != null && !function.isEmpty() && !function.contains(")"); //$NON-NLS-1$ }; }, new LabelText( diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java index dddc875e54f..b77e3cd4750 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/ElementNumberFormatProvider.java @@ -156,7 +156,7 @@ public class ElementNumberFormatProvider implements IElementFormatProvider final CountingRequestMonitor crm = new ImmediateCountingRequestMonitor() { @Override protected void handleCompleted() { - if (elementsToRefresh.size() > 0) { + if (!elementsToRefresh.isEmpty()) { // Send the event to all DSF sessions as they share the same view and the // change of format will affect them as well. This is because they key // we use from this implementation of getElementKey() is not specific to diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenUpdate.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenUpdate.java index 89fda8b4df0..f866ff48894 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenUpdate.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/VMChildrenUpdate.java @@ -129,7 +129,7 @@ public class VMChildrenUpdate extends VMViewerUpdate implements IChildrenUpdate if (VMViewerUpdateTracing.DEBUG_VMUPDATES && !isCanceled() && VMViewerUpdateTracing.matchesFilterRegex(this.getClass())) { StringBuilder str = new StringBuilder(); str.append(DsfPlugin.getDebugTime() + " " + LoggingUtils.toString(this) + " marked done; element = " + LoggingUtils.toString(getElement())); //$NON-NLS-1$ //$NON-NLS-2$ - if (fElements != null && fElements.size() > 0) { + if (fElements != null && !fElements.isEmpty()) { for (Object element : fElements) { str.append(" " + LoggingUtils.toString(element) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java index 40cf9c16406..ab88d0bad1b 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/update/AbstractCachingVMProvider.java @@ -650,7 +650,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider DsfUIPlugin.debug("cachePartialHitChildren(node = " + node + ", update = " + update + ", missing = " + childrenMissingFromCache + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } - if (childrenMissingFromCache.size() > 0) { + if (!childrenMissingFromCache.isEmpty()) { // Note: it is possible that entry.fAllChildrenKnown == true at this point. // This can happen if the node's has children implementation returns true // while the actual children update returns with no elements. A node @@ -662,12 +662,12 @@ public class AbstractCachingVMProvider extends AbstractVMProvider // proxy updates for the continuous ranges of missing children. List partialUpdates = new ArrayList(2); final CountingRequestMonitor multiRm = new ViewerCountingRequestMonitor(getExecutor(), update); - while(childrenMissingFromCache.size() > 0) + while(!childrenMissingFromCache.isEmpty()) { final int offset = childrenMissingFromCache.get(0); childrenMissingFromCache.remove(0); int length = 1; - while(childrenMissingFromCache.size() > 0 && childrenMissingFromCache.get(0) == offset + length) + while(!childrenMissingFromCache.isEmpty() && childrenMissingFromCache.get(0) == offset + length) { length++; childrenMissingFromCache.remove(0); diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/AbstractDMContext.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/AbstractDMContext.java index 2f5fa1fffc8..c31b08ea23c 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/AbstractDMContext.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/datamodel/AbstractDMContext.java @@ -106,7 +106,7 @@ abstract public class AbstractDMContext extends PlatformObject retVal.append(parent); retVal.append(','); } - if (retVal.length() > 0) { + if (retVal.length() > 0) { retVal.deleteCharAt(retVal.length() - 1); // remove trailing comma } if (getParents().length > 1) { diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java index 7d2e4ed750c..4077b56597a 100644 --- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java +++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/BreakpointsMediator2.java @@ -478,7 +478,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo Map> platformBPs = fPlatformBPs.get(bpContext); - if (platformBPs != null && platformBPs.size() > 0) + if (platformBPs != null && !platformBPs.isEmpty()) { for(Map.Entry> e: platformBPs.entrySet()) { @@ -531,7 +531,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo @Override protected void handleCompleted() { // Store successful targetBPs with the platform breakpoint - if (targetBPsInstalled.size() > 0) + if (!targetBPsInstalled.isEmpty()) platformBPs.put(breakpoint, targetBPsInstalled); // Store all targetBPs, success or failure, in the rm. @@ -871,7 +871,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo final PlatformBreakpointInfo[] oneBPInfo = new PlatformBreakpointInfo[] {bpinfo}; IBreakpoint[] oneBP = new IBreakpoint[] {bpinfo.breakpoint}; - if (reinstallContexts.size() > 0) { + if (!reinstallContexts.isEmpty()) { // Check if it's only enablement change (user click enable/disable // button or "Skip all breakpoints" button), which is common operation. // @@ -897,7 +897,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo } } - if (updateContexts.size() > 0) + if (!updateContexts.isEmpty()) modifyTargetBreakpoints(bpinfo.breakpoint, updateContexts, attrDelta); } } @@ -1101,7 +1101,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo pendingEventsList = new LinkedList(); fPendingEvents.put(breakpoint, pendingEventsList); } - if (pendingEventsList.size() > 0 && + if (!pendingEventsList.isEmpty() && pendingEventsList.getLast().fEventType == BreakpointEventType.MODIFIED) { pendingEventsList.removeLast(); }