Skip to content

Commit b6c4923

Browse files
author
Jing Yu
committed
modify 2 mutations
1 parent 49baf95 commit b6c4923

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

6 KB
Binary file not shown.

src/main/java/org/apache/commons/cli/CommandLine.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ public String[] getArgs() {
136136
*/
137137
@Deprecated
138138
public Object getOptionObject(final char opt) {
139-
return getOptionObject(String.valueOf(opt));
139+
getOptionObject(String.valueOf(opt));
140+
return null;
140141
}
141142

142143
/**
@@ -290,7 +291,7 @@ public String getOptionValue(final String opt) {
290291
* @return Value of the argument if option is set, and has an argument, otherwise {@code defaultValue}.
291292
*/
292293
public String getOptionValue(final String opt, final String defaultValue) {
293-
return "";
294+
return getOptionValue((Option) null, defaultValue);
294295
}
295296

296297
/**
@@ -424,7 +425,7 @@ public boolean hasOption(final Option opt) {
424425
* @return true if set, false if not.
425426
*/
426427
public boolean hasOption(final String opt) {
427-
return true;
428+
return hasOption(resolveOption(opt));
428429
}
429430

430431
/**

0 commit comments

Comments
 (0)