Skip to content

Commit 29fefd2

Browse files
committed
Fix checkstyle warnings, minor formatting, typos, complete javadoc for not yet implemented methods.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/cli/trunk@1439197 13f79535-47bb-0310-9956-ffa450edef68
1 parent 6432232 commit 29fefd2

5 files changed

Lines changed: 36 additions & 11 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* if any exists, a flag indicating if an argument is required for
2727
* this option, and a self-documenting description of the option.</p>
2828
*
29-
* <p>An Option is not created independantly, but is create through
29+
* <p>An Option is not created independently, but is create through
3030
* an instance of {@link Options}.<p>
3131
*
3232
* @see org.apache.commons.cli.Options

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
*/
2727
class OptionValidator
2828
{
29+
/**
30+
* Hide constructor for a utility class.
31+
*/
32+
private OptionValidator()
33+
{
34+
}
35+
2936
/**
3037
* Validates whether <code>opt</code> is a permissable Option
3138
* shortOpt. The rules that specify if the <code>opt</code>
@@ -68,7 +75,8 @@ static void validateOption(String opt) throws IllegalArgumentException
6875
{
6976
if (!isValidChar(ch))
7077
{
71-
throw new IllegalArgumentException("The option '" + opt + "' contains an illegal character : '" + ch + "'");
78+
throw new IllegalArgumentException("The option '" + opt + "' contains an illegal "
79+
+ "character : '" + ch + "'");
7280
}
7381
}
7482
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ protected List getRequiredOptions()
6868
* flattening when a non option has been encountered
6969
* @return a String array of the flattened arguments
7070
*/
71-
protected abstract String[] flatten(Options opts, String[] arguments, boolean stopAtNonOption) throws ParseException;
71+
protected abstract String[] flatten(Options opts, String[] arguments, boolean stopAtNonOption)
72+
throws ParseException;
7273

7374
/**
7475
* Parses the specified <code>arguments</code> based
@@ -139,7 +140,8 @@ public CommandLine parse(Options options, String[] arguments, boolean stopAtNonO
139140
*
140141
* @since 1.1
141142
*/
142-
public CommandLine parse(Options options, String[] arguments, Properties properties, boolean stopAtNonOption) throws ParseException
143+
public CommandLine parse(Options options, String[] arguments, Properties properties, boolean stopAtNonOption)
144+
throws ParseException
143145
{
144146
// clear out the data in options in case it's been used before (CLI-71)
145147
for (Option opt : options.helpOptions()) {

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

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
import java.util.Date;
2626

2727
/**
28-
* This is a temporary implementation. TypeHandler will handle the
29-
* pluggableness of OptionTypes and it will direct all of these types
30-
* of conversion functionalities to ConvertUtils component in Commons
31-
* already. BeanUtils I think.
32-
*
33-
* @version $Revision$, $Date$
34-
*/
28+
* This is a temporary implementation. TypeHandler will handle the
29+
* pluggableness of OptionTypes and it will direct all of these types
30+
* of conversion functionalities to ConvertUtils component in Commons
31+
* already. BeanUtils I think.
32+
*
33+
* @version $Revision$, $Date$
34+
*/
3535
public class TypeHandler
3636
{
3737
/**
@@ -178,10 +178,14 @@ public static Class createClass(String classname) throws ParseException
178178

179179
/**
180180
* Returns the date represented by <code>str</code>.
181+
* <p>
182+
* This method is not yet implemented and always throws an
183+
* {@link UnsupportedOperationException}.
181184
*
182185
* @param str the date string
183186
* @return The date if <code>str</code> is a valid date string,
184187
* otherwise return null.
188+
* @throws UnsupportedOperationException always
185189
*/
186190
public static Date createDate(String str) throws ParseException
187191
{
@@ -220,9 +224,13 @@ public static File createFile(String str) throws ParseException
220224

221225
/**
222226
* Returns the File[] represented by <code>str</code>.
227+
* <p>
228+
* This method is not yet implemented and always throws an
229+
* {@link UnsupportedOperationException}.
223230
*
224231
* @param str the paths to the files
225232
* @return The File[] represented by <code>str</code>.
233+
* @throws UnsupportedOperationException always
226234
*/
227235
public static File[] createFiles(String str) throws ParseException
228236
{

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
*/
2626
class Util
2727
{
28+
/**
29+
* Hide constructor for a utility class.
30+
*/
31+
private Util()
32+
{
33+
}
34+
2835
/**
2936
* Remove the hyphens from the begining of <code>str</code> and
3037
* return the new String.

0 commit comments

Comments
 (0)