commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r384971 - in /jakarta/commons/proper/cli/trunk/src: java/org/apache/commons/cli2/commandline/Parser.java test/org/apache/commons/cli2/DocumentationTest.java
Date Sat, 11 Mar 2006 00:49:41 GMT
Author: bayard
Date: Fri Mar 10 16:49:39 2006
New Revision: 384971

URL: http://svn.apache.org/viewcvs?rev=384971&view=rev
Log:
Applying patch 17864 to remove the unnecessary try/catch blocks for IOException. Thanks James.


Modified:
    jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java
    jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java

Modified: jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java?rev=384971&r1=384970&r2=384971&view=diff
==============================================================================
--- jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java
(original)
+++ jakarta/commons/proper/cli/trunk/src/java/org/apache/commons/cli2/commandline/Parser.java
Fri Mar 10 16:49:39 2006
@@ -117,8 +117,7 @@
      * @return a valid CommandLine or null if the parse was unsuccessful
      * @throws IOException if an error occurs while formatting help
      */
-    public CommandLine parseAndHelp(final String[] arguments)
-        throws IOException {
+    public CommandLine parseAndHelp(final String[] arguments) {
         helpFormatter.setGroup(group);
 
         try {

Modified: jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java?rev=384971&r1=384970&r2=384971&view=diff
==============================================================================
--- jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java
(original)
+++ jakarta/commons/proper/cli/trunk/src/test/org/apache/commons/cli2/DocumentationTest.java
Fri Mar 10 16:49:39 2006
@@ -183,26 +183,21 @@
         
         ///////////////////////////////////////////////////
         
-        try {
-            Group options = outputChildren;
-            HelpFormatter hf = new HelpFormatter();
-            
-            Parser p = new Parser();
-            p.setGroup(options);
-            p.setHelpFormatter(hf);
-            p.setHelpTrigger("--help");
-            CommandLine cl = p.parseAndHelp(new String[]{});
-            if(cl==null) {
-                System.exit(-1);
-            }
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+        Group options = outputChildren;
+        HelpFormatter hf = new HelpFormatter();
+
+        Parser p = new Parser();
+        p.setGroup(options);
+        p.setHelpFormatter(hf);
+        p.setHelpTrigger("--help");
+        CommandLine cl = p.parseAndHelp(new String[]{});
+        if(cl==null) {
+            System.exit(-1);
         }
         
         //////////////////////////////////////////////////
         
-        CommandLine cl = new WriteableCommandLineImpl(outputChildren,new ArrayList());
+        cl = new WriteableCommandLineImpl(outputChildren,new ArrayList());
         
         // if we have --output option
         if(cl.hasOption("--output")) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message