commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1440544 - in /commons/proper/cli/trunk/src: main/java/org/apache/commons/cli/PatternOptionBuilder.java test/java/org/apache/commons/cli/ParserTestCase.java test/java/org/apache/commons/cli/PatternOptionBuilderTest.java
Date Wed, 30 Jan 2013 17:39:50 GMT
Author: sebb
Date: Wed Jan 30 17:39:50 2013
New Revision: 1440544

URL: http://svn.apache.org/viewvc?rev=1440544&view=rev
Log:
Fix some obvious raw types

Modified:
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
    commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/ParserTestCase.java
    commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java?rev=1440544&r1=1440543&r2=1440544&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
(original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/PatternOptionBuilder.java
Wed Jan 30 17:39:50 2013
@@ -55,16 +55,16 @@ import java.util.Date;
 public class PatternOptionBuilder
 {
     /** String class */
-    public static final Class STRING_VALUE = String.class;
+    public static final Class<String> STRING_VALUE = String.class;
 
     /** Object class */
-    public static final Class OBJECT_VALUE = Object.class;
+    public static final Class<Object> OBJECT_VALUE = Object.class;
 
     /** Number class */
-    public static final Class NUMBER_VALUE = Number.class;
+    public static final Class<Number> NUMBER_VALUE = Number.class;
 
     /** Date class */
-    public static final Class DATE_VALUE = Date.class;
+    public static final Class<Date> DATE_VALUE = Date.class;
 
     /** Class class */
     public static final Class CLASS_VALUE = Class.class;
@@ -74,16 +74,16 @@ public class PatternOptionBuilder
     // ie) it's for reading not writing.
 
     /** FileInputStream class */
-    public static final Class EXISTING_FILE_VALUE = FileInputStream.class;
+    public static final Class<FileInputStream> EXISTING_FILE_VALUE = FileInputStream.class;
 
     /** File class */
-    public static final Class FILE_VALUE = File.class;
+    public static final Class<File> FILE_VALUE = File.class;
 
     /** File array class */
-    public static final Class FILES_VALUE = File[].class;
+    public static final Class<File[]> FILES_VALUE = File[].class;
 
     /** URL class */
-    public static final Class URL_VALUE = URL.class;
+    public static final Class<URL> URL_VALUE = URL.class;
 
     /**
      * Retrieve the class that <code>ch</code> represents.

Modified: commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/ParserTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/ParserTestCase.java?rev=1440544&r1=1440543&r2=1440544&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/ParserTestCase.java (original)
+++ commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/ParserTestCase.java Wed
Jan 30 17:39:50 2013
@@ -421,7 +421,7 @@ public abstract class ParserTestCase ext
 
         CommandLine cl = parser.parse(options, args);
 
-        List values = Arrays.asList(cl.getOptionValues("J"));
+        List<String> values = Arrays.asList(cl.getOptionValues("J"));
         assertNotNull("null values", values);
         assertEquals("number of values", 4, values.size());
         assertEquals("value 1", "source", values.get(0));
@@ -429,7 +429,7 @@ public abstract class ParserTestCase ext
         assertEquals("value 3", "target", values.get(2));
         assertEquals("value 4", "1.5", values.get(3));
         
-        List argsleft = cl.getArgList();
+        List<?> argsleft = cl.getArgList();
         assertEquals("Should be 1 arg left", 1, argsleft.size());
         assertEquals("Expecting foo", "foo", argsleft.get(0));
     }
@@ -449,7 +449,7 @@ public abstract class ParserTestCase ext
         assertEquals("property 1", "true", props.getProperty("param1"));
         assertEquals("property 2", "value2", props.getProperty("param2"));
         
-        List argsleft = cl.getArgList();
+        List<?> argsleft = cl.getArgList();
         assertEquals("Should be no arg left", 0, argsleft.size());
     }
 

Modified: commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java?rev=1440544&r1=1440543&r2=1440544&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java
(original)
+++ commons/proper/cli/trunk/src/test/java/org/apache/commons/cli/PatternOptionBuilderTest.java
Wed Jan 30 17:39:50 2013
@@ -43,7 +43,7 @@ public class PatternOptionBuilderTest ex
 
         assertEquals("flag a", "foo", line.getOptionValue("a"));
         assertEquals("string flag a", "foo", line.getOptionObject("a"));
-        assertEquals("object flag b", new Vector(), line.getOptionObject("b"));
+        assertEquals("object flag b", new Vector<Object>(), line.getOptionObject("b"));
         assertTrue("boolean true flag c", line.hasOption("c"));
         assertFalse("boolean false flag d", line.hasOption("d"));
         assertEquals("file flag e", new File("build.xml"), line.getOptionObject("e"));
@@ -54,7 +54,7 @@ public class PatternOptionBuilderTest ex
         // tests the char methods of CommandLine that delegate to the String methods
         assertEquals("flag a", "foo", line.getOptionValue('a'));
         assertEquals("string flag a", "foo", line.getOptionObject('a'));
-        assertEquals("object flag b", new Vector(), line.getOptionObject('b'));
+        assertEquals("object flag b", new Vector<Object>(), line.getOptionObject('b'));
         assertTrue("boolean true flag c", line.hasOption('c'));
         assertFalse("boolean false flag d", line.hasOption('d'));
         assertEquals("file flag e", new File("build.xml"), line.getOptionObject('e'));



Mime
View raw message