You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2013/01/30 10:14:05 UTC

svn commit: r1440310 - in /commons/proper/cli/trunk/src/main/java/org/apache/commons/cli: Option.java OptionBuilder.java

Author: tn
Date: Wed Jan 30 09:14:05 2013
New Revision: 1440310

URL: http://svn.apache.org/viewvc?rev=1440310&view=rev
Log:
Fix clirr errors by adding old method signatures and deprecating them.

Modified:
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Option.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Option.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Option.java?rev=1440310&r1=1440309&r2=1440310&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Option.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Option.java Wed Jan 30 09:14:05 2013
@@ -69,7 +69,7 @@ public class Option implements Cloneable
     private int numberOfArgs = UNINITIALIZED;
 
     /** the type of this Option */
-    private Class type = String.class;
+    private Class<?> type = String.class;
 
     /** the list of argument values **/
     private List<String> values = new ArrayList<String>();
@@ -190,6 +190,21 @@ public class Option implements Cloneable
 
     /**
      * Sets the type of this Option.
+     * <p>
+     * <b>Note:</b> this method is kept for binary compatibility and the
+     * input type is supposed to be a {@link Class} object. 
+     *
+     * @param type the type of this Option
+     * @deprecated since 1.3, use {@link #setType(Class)} instead
+     */
+    @Deprecated
+    public void setType(Object type)
+    {
+        setType((Class) type);
+    }
+
+    /**
+     * Sets the type of this Option.
      *
      * @param type the type of this Option
      */

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java?rev=1440310&r1=1440309&r2=1440310&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionBuilder.java Wed Jan 30 09:14:05 2013
@@ -283,6 +283,23 @@ public final class OptionBuilder
     /**
      * The next Option created will have a value that will be an instance
      * of <code>type</code>.
+     * <p>
+     * <b>Note:</b> this method is kept for binary compatibility and the
+     * input type is supposed to be a {@link Class} object. 
+     *
+     * @param newType the type of the Options argument value
+     * @return the OptionBuilder instance
+     * @deprecated since 1.3, use {@link #withType(Class)} instead
+     */
+    @Deprecated
+    public static OptionBuilder withType(Object newType)
+    {
+        return withType((Class) newType);
+    }
+
+    /**
+     * The next Option created will have a value that will be an instance
+     * of <code>type</code>.
      *
      * @param newType the type of the Options argument value
      * @return the OptionBuilder instance