Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Oct 22, 2021
1 parent 145f112 commit 2f21cae
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ private static int s(String a, String b) {
public String getOptAndLongOpt() {
StringBuilder sb = new StringBuilder();
boolean havePrev = false;
if (opt != null && opt.length() > 0) {
if (opt != null && !opt.isEmpty()) {
sb.append("-").append(opt);
havePrev = true;
}
if (longOpt != null && longOpt.length() > 0) {
if (longOpt != null && !longOpt.isEmpty()) {
if (havePrev) {
sb.append(",");
}
Expand Down Expand Up @@ -297,7 +297,7 @@ public void doMain(String... args) {
doCommandLine();
} catch (HelpException e) {
String msg = e.getMessage();
if (msg != null && msg.length() > 0) {
if (msg != null && !msg.isEmpty()) {
System.err.println("ERROR: " + msg);
}
usage();
Expand Down Expand Up @@ -388,7 +388,7 @@ protected void initOptionFromClass(Class<?> clz) {
}

private static String fromCamel(String name) {
if (name.length() == 0) {
if (name.isEmpty()) {
return "";
}
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -528,7 +528,7 @@ protected void usage() {
sb.append(" <").append(option.argName).append(">");
}
String desc = option.description;
if (desc == null || desc.length() == 0) { // no description
if (desc == null || desc.isEmpty()) { // no description
out.println(sb);
} else {
for (int i = palength - sb.length(); i > 0; i--) {
Expand Down

0 comments on commit 2f21cae

Please sign in to comment.