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) {