Skip to content

Commit d8df510

Browse files
committed
Fixed some of the checkstyle errors
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/trunk@955185 13f79535-47bb-0310-9956-ffa450edef68
1 parent d3ca03e commit d8df510

6 files changed

Lines changed: 19 additions & 10 deletions

File tree

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
*/
4343
public class CommandLine implements Serializable
4444
{
45+
/** The serial version UID. */
4546
private static final long serialVersionUID = 1L;
4647

4748
/** the unrecognised options/arguments */
@@ -89,11 +90,13 @@ public boolean hasOption(char opt)
8990
*/
9091
public Object getOptionObject(String opt)
9192
{
92-
try {
93+
try
94+
{
9395
return getParsedOptionValue(opt);
94-
} catch(ParseException pe) {
95-
System.err.println("Exception found converting " + opt + " to desired type: " +
96-
pe.getMessage() );
96+
}
97+
catch (ParseException pe)
98+
{
99+
System.err.println("Exception found converting " + opt + " to desired type: " + pe.getMessage());
97100
return null;
98101
}
99102
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,8 +763,8 @@ protected StringBuffer renderOptions(StringBuffer sb, int width, Options options
763763
for (Iterator i = optList.iterator(); i.hasNext();)
764764
{
765765
Option option = (Option) i.next();
766-
optBuf = new StringBuffer(8);
767-
766+
optBuf = new StringBuffer();
767+
768768
if (option.getOpt() == null)
769769
{
770770
optBuf.append(lpad).append(" " + defaultLongOptPrefix).append(option.getLongOpt());
@@ -874,7 +874,7 @@ protected StringBuffer renderWrappedText(StringBuffer sb, int width,
874874
return sb;
875875
}
876876

877-
if ( (text.length() > width) && (pos == nextLineTabStop - 1) )
877+
if ((text.length() > width) && (pos == nextLineTabStop - 1))
878878
{
879879
pos = width;
880880
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
*/
3939
public class Option implements Cloneable, Serializable
4040
{
41+
/** The serial version UID. */
4142
private static final long serialVersionUID = 1L;
4243

4344
/** constant that specifies the number of argument values has not been specified */
@@ -619,7 +620,7 @@ public boolean equals(Object o)
619620
public int hashCode()
620621
{
621622
int result;
622-
result = (opt != null ? opt.hashCode() : 0);
623+
result = opt != null ? opt.hashCode() : 0;
623624
result = 31 * result + (longOpt != null ? longOpt.hashCode() : 0);
624625
return result;
625626
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,8 @@ public static Option create() throws IllegalArgumentException
346346
public static Option create(String opt) throws IllegalArgumentException
347347
{
348348
Option option = null;
349-
try {
349+
try
350+
{
350351
// create the option
351352
option = new Option(opt, description);
352353

@@ -358,7 +359,9 @@ public static Option create(String opt) throws IllegalArgumentException
358359
option.setType(type);
359360
option.setValueSeparator(valuesep);
360361
option.setArgName(argName);
361-
} finally {
362+
}
363+
finally
364+
{
362365
// reset the OptionBuilder properties
363366
OptionBuilder.reset();
364367
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*/
3232
public class OptionGroup implements Serializable
3333
{
34+
/** The serial version UID. */
3435
private static final long serialVersionUID = 1L;
3536

3637
/** hold the options */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
*/
4646
public class Options implements Serializable
4747
{
48+
/** The serial version UID. */
4849
private static final long serialVersionUID = 1L;
4950

5051
/** a map of the options with the character key */

0 commit comments

Comments
 (0)