Skip to content

Commit a3e2d6b

Browse files
committed
Add missing @deprecated and @OverRide.
1 parent 02aba6c commit a3e2d6b

9 files changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public Object getParsedOptionValue(final char opt) throws ParseException
167167
* @param opt the name of the option.
168168
* @return the type of opt.
169169
*/
170+
@Deprecated
170171
public Object getOptionObject(final char opt)
171172
{
172173
return getOptionObject(String.valueOf(opt));

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public DefaultParser(final boolean allowPartialMatching) {
101101
this.allowPartialMatching = allowPartialMatching;
102102
}
103103

104+
@Override
104105
public CommandLine parse(final Options options, final String[] arguments) throws ParseException
105106
{
106107
return parse(options, arguments, null);
@@ -122,6 +123,7 @@ public CommandLine parse(final Options options, final String[] arguments, final
122123
return parse(options, arguments, properties, false);
123124
}
124125

126+
@Override
125127
public CommandLine parse(final Options options, final String[] arguments, final boolean stopAtNonOption) throws ParseException
126128
{
127129
return parse(options, arguments, null, stopAtNonOption);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ private static class OptionComparator implements Comparator<Option>, Serializabl
10831083
* the first argument is less than, equal to, or greater than the
10841084
* second.
10851085
*/
1086+
@Override
10861087
public int compare(final Option opt1, final Option opt2)
10871088
{
10881089
return opt1.getKey().compareToIgnoreCase(opt2.getKey());

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ protected abstract String[] flatten(Options opts, String[] arguments, boolean st
8282
* @throws ParseException if there are any problems encountered
8383
* while parsing the command line tokens.
8484
*/
85+
@Override
8586
public CommandLine parse(final Options options, final String[] arguments) throws ParseException
8687
{
8788
return parse(options, arguments, null, false);
@@ -117,6 +118,7 @@ public CommandLine parse(final Options options, final String[] arguments, final
117118
* @return the <code>CommandLine</code>
118119
* @throws ParseException if an error occurs when parsing the arguments.
119120
*/
121+
@Override
120122
public CommandLine parse(final Options options, final String[] arguments, final boolean stopAtNonOption) throws ParseException
121123
{
122124
return parse(options, arguments, null, stopAtNonOption);

src/test/java/org/apache/commons/cli/BasicParserTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
@SuppressWarnings("deprecation") // tests some deprecated classes
2525
public class BasicParserTest extends ParserTestCase
2626
{
27+
@Override
2728
@Before
2829
public void setUp()
2930
{

src/test/java/org/apache/commons/cli/DefaultParserTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
public class DefaultParserTest extends ParserTestCase {
2323

24+
@Override
2425
@Before
2526
public void setUp() {
2627
super.setUp();

src/test/java/org/apache/commons/cli/GnuParserTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
@SuppressWarnings("deprecation") // tests some deprecated classes
2525
public class GnuParserTest extends ParserTestCase
2626
{
27+
@Override
2728
@Before
2829
public void setUp()
2930
{

src/test/java/org/apache/commons/cli/HelpFormatterTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ public void testPrintSortedUsage()
287287
final HelpFormatter helpFormatter = new HelpFormatter();
288288
helpFormatter.setOptionComparator(new Comparator<Option>()
289289
{
290+
@Override
290291
public int compare(final Option opt1, final Option opt2)
291292
{
292293
// reverses the functionality of the default comparator

src/test/java/org/apache/commons/cli/PosixParserTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*/
2727
public class PosixParserTest extends ParserTestCase
2828
{
29+
@Override
2930
@SuppressWarnings("deprecation")
3031
@Before
3132
public void setUp()

0 commit comments

Comments
 (0)