mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
replace size()|length() > 0 with !isEmpty()
isEmpty is garantied to be as fast or faster than size and length. It is also easier to read. Change-Id: Ia768910c21313666aeab774963c0b6e82d825b44 Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
This commit is contained in:
parent
9105e2d42c
commit
f517c704bc
49 changed files with 104 additions and 104 deletions
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<String> 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),
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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<MIInfo>(rm));
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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(')');
|
||||
|
|
|
@ -481,7 +481,7 @@ public class MIRegisters extends AbstractDsfService implements IRegisters, ICach
|
|||
List<MIRegisterDMC> regDmcList = new ArrayList<MIRegisters.MIRegisterDMC>( 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
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<Boolean> 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<Boolean> 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<Boolean> 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<ChildrenInfo> 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<ChildrenInfo> 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<Boolean> 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<Boolean> 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<Boolean> pendingRm = updatesPending.poll();
|
||||
pendingRm.setStatus(getStatus());
|
||||
pendingRm.done();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -106,7 +106,7 @@ public class MIBreakInsert extends MICommand<MIBreakInsertInfo>
|
|||
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<MIBreakInsertInfo>
|
|||
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;
|
||||
|
|
|
@ -166,11 +166,11 @@ public class MICommand<V extends MIInfo> implements ICommand<V> {
|
|||
}
|
||||
|
||||
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<V extends MIInfo> implements ICommand<V> {
|
|||
|
||||
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<V extends MIInfo> implements ICommand<V> {
|
|||
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) {
|
||||
|
|
|
@ -71,7 +71,7 @@ public class MIDPrintfInsert extends MICommand<MIBreakInsertInfo>
|
|||
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<MIBreakInsertInfo>
|
|||
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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -88,7 +88,7 @@ public class CLIInfoSharedLibraryInfo extends MIInfo {
|
|||
}
|
||||
|
||||
void parseShared(String str, List<DsfMISharedInfo> 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);
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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$
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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$
|
||||
|
|
|
@ -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<StyleRange> iter = styleRanges.iterator(); iter.hasNext();) {
|
||||
textPresentation.addStyleRange(iter.next());
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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<String,Object> 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<String,Object> 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<String,Object> 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<String,Object> 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<String,Object> 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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
|
|
|
@ -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<IChildrenUpdate> partialUpdates = new ArrayList<IChildrenUpdate>(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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -478,7 +478,7 @@ public class BreakpointsMediator2 extends AbstractDsfService implements IBreakpo
|
|||
|
||||
Map<IBreakpoint, List<ITargetBreakpointInfo>> platformBPs = fPlatformBPs.get(bpContext);
|
||||
|
||||
if (platformBPs != null && platformBPs.size() > 0)
|
||||
if (platformBPs != null && !platformBPs.isEmpty())
|
||||
{
|
||||
for(Map.Entry<IBreakpoint, List<ITargetBreakpointInfo>> 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<PendingEventInfo>();
|
||||
fPendingEvents.put(breakpoint, pendingEventsList);
|
||||
}
|
||||
if (pendingEventsList.size() > 0 &&
|
||||
if (!pendingEventsList.isEmpty() &&
|
||||
pendingEventsList.getLast().fEventType == BreakpointEventType.MODIFIED) {
|
||||
pendingEventsList.removeLast();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue