commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject svn commit: r1091539 - in /commons/proper/cli/trunk: ./ src/main/java/org/apache/commons/cli/
Date Tue, 12 Apr 2011 18:57:30 GMT
Author: ebourg
Date: Tue Apr 12 18:57:29 2011
New Revision: 1091539

URL: http://svn.apache.org/viewvc?rev=1091539&view=rev
Log:
Moving to Java 5

Modified:
    commons/proper/cli/trunk/pom.xml
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/AmbiguousOptionException.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/CommandLine.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/DefaultParser.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/HelpFormatter.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/MissingOptionException.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Option.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionGroup.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java
    commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java

Modified: commons/proper/cli/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/pom.xml?rev=1091539&r1=1091538&r2=1091539&view=diff
==============================================================================
--- commons/proper/cli/trunk/pom.xml (original)
+++ commons/proper/cli/trunk/pom.xml Tue Apr 12 18:57:29 2011
@@ -151,10 +151,10 @@
   </dependencies>
 
   <properties>
-    <maven.compile.source>1.4</maven.compile.source>
-    <maven.compile.target>1.4</maven.compile.target>
+    <maven.compile.source>1.5</maven.compile.source>
+    <maven.compile.target>1.5</maven.compile.target>
     <commons.componentid>cli</commons.componentid>
-    <commons.release.version>1.2</commons.release.version>
+    <commons.release.version>1.3</commons.release.version>
     <commons.release.name>commons-cli-${commons.release.version}</commons.release.name>
     <commons.osgi.symbolicName>org.apache.commons.cli</commons.osgi.symbolicName>
     <commons.jira.id>CLI</commons.jira.id>

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/AmbiguousOptionException.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/AmbiguousOptionException.java?rev=1091539&r1=1091538&r2=1091539&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/AmbiguousOptionException.java
(original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/AmbiguousOptionException.java
Tue Apr 12 18:57:29 2011
@@ -30,7 +30,7 @@ import java.util.Iterator;
 public class AmbiguousOptionException extends UnrecognizedOptionException
 {
     /** The list of options matching the partial name specified */
-    private Collection matchingOptions;
+    private Collection<String> matchingOptions;
 
     /**
      * Constructs a new AmbiguousOptionException.
@@ -38,7 +38,7 @@ public class AmbiguousOptionException ex
      * @param option          the partial option name
      * @param matchingOptions the options matching the name
      */
-    public AmbiguousOptionException(String option, Collection matchingOptions)
+    public AmbiguousOptionException(String option, Collection<String> matchingOptions)
     {
         super(createMessage(option, matchingOptions), option);
         this.matchingOptions = matchingOptions;
@@ -47,7 +47,7 @@ public class AmbiguousOptionException ex
     /**
      * Returns the options matching the partial name.
      */
-    public Collection getMatchingOptions()
+    public Collection<String> getMatchingOptions()
     {
         return matchingOptions;
     }
@@ -59,7 +59,7 @@ public class AmbiguousOptionException ex
      * @param matchingOptions
      * @return
      */
-    private static String createMessage(String option, Collection matchingOptions)
+    private static String createMessage(String option, Collection<String> matchingOptions)
     {
         StringBuffer buff = new StringBuffer("Ambiguous option: '");
         buff.append(option);

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/CommandLine.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/CommandLine.java?rev=1091539&r1=1091538&r2=1091539&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/CommandLine.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/CommandLine.java Tue Apr
12 18:57:29 2011
@@ -46,10 +46,10 @@ public class CommandLine implements Seri
     private static final long serialVersionUID = 1L;
 
     /** the unrecognised options/arguments */
-    private List args = new LinkedList();
+    private List<String> args = new LinkedList<String>();
 
     /** the processed options */
-    private List options = new ArrayList();
+    private List<Option> options = new ArrayList<Option>();
 
     /**
      * Creates a command line.
@@ -169,18 +169,17 @@ public class CommandLine implements Seri
      */
     public String[] getOptionValues(String opt)
     {
-        List values = new ArrayList();
+        List<String> values = new ArrayList<String>();
 
-        for (Iterator it = options.iterator(); it.hasNext();)
+        for (Option option : options)
         {
-            Option option = (Option) it.next();
             if (opt.equals(option.getOpt()) || opt.equals(option.getLongOpt()))
             {
                 values.addAll(option.getValuesList());
             }
         }
 
-        return values.isEmpty() ? null : (String[]) values.toArray(new String[values.size()]);
+        return values.isEmpty() ? null : values.toArray(new String[values.size()]);
     }
 
     /**
@@ -192,9 +191,7 @@ public class CommandLine implements Seri
     private Option resolveOption(String opt)
     {
         opt = Util.stripLeadingHyphens(opt);
-        for (Iterator it = options.iterator(); it.hasNext();)
-        {
-            Option option = (Option) it.next();
+        for (Option option : options) {
             if (opt.equals(option.getOpt()))
             {
                 return option;
@@ -268,13 +265,11 @@ public class CommandLine implements Seri
     {
         Properties props = new Properties();
 
-        for (Iterator it = options.iterator(); it.hasNext();)
+        for (Option option : options)
         {
-            Option option = (Option) it.next();
-
             if (opt.equals(option.getOpt()) || opt.equals(option.getLongOpt()))
             {
-                List values = option.getValuesList();
+                List<String> values = option.getValuesList();
                 if (values.size() >= 2)
                 {
                     // use the first 2 arguments as the key/value pair
@@ -310,7 +305,7 @@ public class CommandLine implements Seri
      *
      * @return remaining items passed in but not parsed as a <code>List</code>.
      */
-    public List getArgList()
+    public List<String> getArgList()
     {
         return args;
     }
@@ -375,12 +370,12 @@ public class CommandLine implements Seri
      */
     public Option[] getOptions()
     {
-        Collection processed = options;
+        Collection<Option> processed = options;
 
         // reinitialise array
         Option[] optionsArray = new Option[processed.size()];
 
         // return the array
-        return (Option[]) processed.toArray(optionsArray);
+        return processed.toArray(optionsArray);
     }
 }

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/DefaultParser.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/DefaultParser.java?rev=1091539&r1=1091538&r2=1091539&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/DefaultParser.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/DefaultParser.java Tue Apr
12 18:57:29 2011
@@ -19,7 +19,6 @@ package org.apache.commons.cli;
 
 import java.util.ArrayList;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 
@@ -51,7 +50,7 @@ public class DefaultParser implements Co
     /** Flag indicating if tokens should no longer be analysed and simply added as arguments
of the command line. */
     protected boolean skipParsing;
     
-    /** The required options expected to be found when parsing the command line. */
+    /** The required options and groups expected to be found when parsing the command line.
*/
     protected List expectedOpts;
     
     public CommandLine parse(Options options, String[] arguments) throws ParseException
@@ -104,9 +103,8 @@ public class DefaultParser implements Co
         expectedOpts = new ArrayList(options.getRequiredOptions());
         
         // clear the data from the groups
-        for (Iterator it = options.getOptionGroups().iterator(); it.hasNext();)
+        for (OptionGroup group : options.getOptionGroups())
         {
-            OptionGroup group = (OptionGroup) it.next();
             group.setSelected(null);
         }
         
@@ -114,9 +112,9 @@ public class DefaultParser implements Co
 
         if (arguments != null)
         {
-            for (int i = 0; i < arguments.length; i++)
+            for (String argument : arguments)
             {
-                handleToken(arguments[i]);
+                handleToken(argument);
             }
         }
         
@@ -387,7 +385,7 @@ public class DefaultParser implements Co
      */
     private void handleLongOptionWithoutEqual(String token) throws ParseException
     {
-        List matchingOpts = options.getMatchingOptions(token);
+        List<String> matchingOpts = options.getMatchingOptions(token);
         if (matchingOpts.isEmpty())
         {
             handleUnknownToken(currentToken);
@@ -398,7 +396,7 @@ public class DefaultParser implements Co
         }
         else
         {
-            handleOption(options.getOption((String) matchingOpts.get(0)));
+            handleOption(options.getOption(matchingOpts.get(0)));
         }
     }
 
@@ -420,7 +418,7 @@ public class DefaultParser implements Co
         
         String opt = token.substring(0, pos);
         
-        List matchingOpts = options.getMatchingOptions(opt);
+        List<String> matchingOpts = options.getMatchingOptions(opt);
         if (matchingOpts.isEmpty())
         {
             handleUnknownToken(currentToken);
@@ -431,7 +429,7 @@ public class DefaultParser implements Co
         }
         else
         {
-            Option option = options.getOption((String) matchingOpts.get(0));
+            Option option = options.getOption(matchingOpts.get(0));
             
             if (option.acceptsArg())
             {
@@ -485,6 +483,7 @@ public class DefaultParser implements Co
         }
         else if (pos == -1)
         {
+            // no equal sign found (-xxx)
             if (options.hasShortOption(t))
             {
                 handleOption(options.getOption(t));
@@ -521,6 +520,7 @@ public class DefaultParser implements Co
         }
         else
         {
+            // equal sign found (-xxx=yyy)
             String opt = t.substring(0, pos);
             String value = t.substring(pos + 1);
             
@@ -595,7 +595,7 @@ public class DefaultParser implements Co
         // check the previous option before handling the next one
         checkRequiredArgs();
         
-        option = (Option) option.clone();
+        option = option.clone();
         
         updateRequiredOptions(option);
         

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/HelpFormatter.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/HelpFormatter.java?rev=1091539&r1=1091538&r2=1091539&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/HelpFormatter.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/HelpFormatter.java Tue Apr
12 18:57:29 2011
@@ -142,7 +142,7 @@ public class HelpFormatter
      * 
      * Defaults to case-insensitive alphabetical sorting by option key
      */
-    protected Comparator optionComparator = new OptionComparator();
+    protected Comparator<Option> optionComparator = new OptionComparator();
     
     /**
      * Sets the 'width'.
@@ -334,7 +334,7 @@ public class HelpFormatter
      * 
      * @since 1.2
      */
-    public Comparator getOptionComparator()
+    public Comparator<Option> getOptionComparator()
     {
         return optionComparator;
     }
@@ -345,7 +345,7 @@ public class HelpFormatter
      * 
      * @since 1.2
      */
-    public void setOptionComparator(Comparator comparator)
+    public void setOptionComparator(Comparator<Option> comparator)
     {
         if (comparator == null)
         {
@@ -544,12 +544,12 @@ public class HelpFormatter
         StringBuffer buff = new StringBuffer(getSyntaxPrefix()).append(app).append(" ");
 
         // create a list for processed option groups
-        final Collection processedGroups = new ArrayList();
+        final Collection<OptionGroup> processedGroups = new ArrayList<OptionGroup>();
 
         // temp variable
         Option option;
 
-        List optList = new ArrayList(options.getOptions());
+        List<Option> optList = new ArrayList<Option>(options.getOptions());
         Collections.sort(optList, getOptionComparator());
         // iterate over the options
         for (Iterator i = optList.iterator(); i.hasNext();)
@@ -610,7 +610,7 @@ public class HelpFormatter
             buff.append("[");
         }
 
-        List optList = new ArrayList(group.getOptions());
+        List<Option> optList = new ArrayList<Option>(group.getOptions());
         Collections.sort(optList, getOptionComparator());
         // for each option in the OptionGroup
         for (Iterator i = optList.iterator(); i.hasNext();)
@@ -758,15 +758,14 @@ public class HelpFormatter
         // sort options ascending
         int max = 0;
         StringBuffer optBuf;
-        List prefixList = new ArrayList();
-
-        List optList = options.helpOptions();
-
+        List<StringBuffer> prefixList = new ArrayList<StringBuffer>();
+        
+        List<Option> optList = options.helpOptions();
+        
         Collections.sort(optList, getOptionComparator());
-
-        for (Iterator i = optList.iterator(); i.hasNext();)
+        
+        for (Option option : optList)
         {
-            Option option = (Option) i.next();
             optBuf = new StringBuffer();
             
             if (option.getOpt() == null)
@@ -1016,25 +1015,21 @@ public class HelpFormatter
      * This class implements the <code>Comparator</code> interface
      * for comparing Options.
      */
-    private static class OptionComparator implements Comparator
+    private static class OptionComparator implements Comparator<Option>
     {
-
         /**
          * Compares its two arguments for order. Returns a negative
          * integer, zero, or a positive integer as the first argument
          * is less than, equal to, or greater than the second.
          *
-         * @param o1 The first Option to be compared.
-         * @param o2 The second Option to be compared.
+         * @param opt1 The first Option to be compared.
+         * @param opt2 The second Option to be compared.
          * @return a negative integer, zero, or a positive integer as
          *         the first argument is less than, equal to, or greater than the
          *         second.
          */
-        public int compare(Object o1, Object o2)
+        public int compare(Option opt1, Option opt2)
         {
-            Option opt1 = (Option) o1;
-            Option opt2 = (Option) o2;
-
             return opt1.getKey().compareToIgnoreCase(opt2.getKey());
         }
     }

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/MissingOptionException.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/MissingOptionException.java?rev=1091539&r1=1091538&r2=1091539&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/MissingOptionException.java
(original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/MissingOptionException.java
Tue Apr 12 18:57:29 2011
@@ -28,7 +28,7 @@ import java.util.Iterator;
  */
 public class MissingOptionException extends ParseException
 {
-    /** The list of missing options */
+    /** The list of missing options and groups */
     private List missingOptions;
 
     /**

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=1091539&r1=1091538&r2=1091539&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 Tue Apr 12 18:57:29
2011
@@ -72,7 +72,7 @@ public class Option implements Cloneable
     private Class type = String.class;
 
     /** the list of argument values **/
-    private List values = new ArrayList();
+    private List<String> values = new ArrayList<String>();
 
     /** the character that is the value separator */
     private char valuesep;
@@ -482,7 +482,7 @@ public class Option implements Cloneable
      */
     public String getValue()
     {
-        return hasNoValues() ? null : (String) values.get(0);
+        return hasNoValues() ? null : values.get(0);
     }
 
     /**
@@ -499,7 +499,7 @@ public class Option implements Cloneable
      */
     public String getValue(int index) throws IndexOutOfBoundsException
     {
-        return hasNoValues() ? null : (String) values.get(index);
+        return hasNoValues() ? null : values.get(index);
     }
 
     /**
@@ -528,14 +528,14 @@ public class Option implements Cloneable
      */
     public String[] getValues()
     {
-        return hasNoValues() ? null : (String[]) values.toArray(new String[values.size()]);
+        return hasNoValues() ? null : values.toArray(new String[values.size()]);
     }
 
     /**
      * @return the values of this Option as a List
      * or null if there are no values
      */
-    public List getValuesList()
+    public List<String> getValuesList()
     {
         return values;
     }
@@ -633,12 +633,12 @@ public class Option implements Cloneable
      *
      * @throws RuntimeException
      */
-    public Object clone()
+    public Option clone()
     {
         try
         {
             Option option = (Option) super.clone();
-            option.values = new ArrayList(values);
+            option.values = new ArrayList<String>(values);
             return option;
         }
         catch (CloneNotSupportedException cnse)

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionGroup.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionGroup.java?rev=1091539&r1=1091538&r2=1091539&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionGroup.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionGroup.java Tue Apr
12 18:57:29 2011
@@ -35,7 +35,7 @@ public class OptionGroup implements Seri
     private static final long serialVersionUID = 1L;
     
     /** hold the options */
-    private Map optionMap = new HashMap();
+    private Map<String, Option> optionMap = new HashMap<String, Option>();
 
     /** the name of the selected option */
     private String selected;
@@ -62,7 +62,7 @@ public class OptionGroup implements Seri
      * @return the names of the options in this group as a 
      * <code>Collection</code>
      */
-    public Collection getNames()
+    public Collection<String> getNames()
     {
         // the key set is the collection of names
         return optionMap.keySet();
@@ -71,7 +71,7 @@ public class OptionGroup implements Seri
     /**
      * @return the options in this group as a <code>Collection</code>
      */
-    public Collection getOptions()
+    public Collection<Option> getOptions()
     {
         // the values are the collection of options
         return optionMap.values();
@@ -139,15 +139,15 @@ public class OptionGroup implements Seri
      */
     public String toString()
     {
-        StringBuffer buff = new StringBuffer();
-
-        Iterator iter = getOptions().iterator();
+        StringBuilder buff = new StringBuilder();
+        
+        Iterator<Option> iter = getOptions().iterator();
 
         buff.append("[");
 
         while (iter.hasNext())
         {
-            Option option = (Option) iter.next();
+            Option option = iter.next();
 
             if (option.getOpt() != null)
             {

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java?rev=1091539&r1=1091538&r2=1091539&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/OptionValidator.java Tue
Apr 12 18:57:29 2011
@@ -64,13 +64,11 @@ class OptionValidator
         // handle the multi character opt
         else
         {
-            char[] chars = opt.toCharArray();
-
-            for (int i = 0; i < chars.length; i++)
+            for (char ch : opt.toCharArray())
             {
-                if (!isValidChar(chars[i]))
+                if (!isValidChar(ch))
                 {
-                    throw new IllegalArgumentException("The option '" + opt + "' contains
an illegal character : '" + chars[i] + "'");
+                    throw new IllegalArgumentException("The option '" + opt + "' contains
an illegal character : '" + ch + "'");
                 }
             }
         }

Modified: commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java
URL: http://svn.apache.org/viewvc/commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java?rev=1091539&r1=1091538&r2=1091539&view=diff
==============================================================================
--- commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java (original)
+++ commons/proper/cli/trunk/src/main/java/org/apache/commons/cli/Options.java Tue Apr 12
18:57:29 2011
@@ -49,16 +49,16 @@ public class Options implements Serializ
     private static final long serialVersionUID = 1L;
 
     /** a map of the options with the character key */
-    private Map shortOpts = new HashMap();
+    private Map<String, Option> shortOpts = new HashMap<String, Option>();
 
     /** a map of the options with the long key */
-    private Map longOpts = new HashMap();
+    private Map<String, Option> longOpts = new HashMap<String, Option>();
 
     /** a map of the required options */
-    private List requiredOpts = new ArrayList();
+    private List<Object> requiredOpts = new ArrayList<Object>();
 
     /** a map of the option groups */
-    private Map optionGroups = new HashMap();
+    private Map<String, OptionGroup> optionGroups = new HashMap<String, OptionGroup>();
 
     /**
      * Add the specified option group.
@@ -96,9 +96,9 @@ public class Options implements Serializ
      *
      * @return a Collection of OptionGroup instances.
      */
-    Collection getOptionGroups()
+    Collection<OptionGroup> getOptionGroups()
     {
-        return new HashSet(optionGroups.values());
+        return new HashSet<OptionGroup>(optionGroups.values());
     }
 
     /**
@@ -170,7 +170,7 @@ public class Options implements Serializ
      *
      * @return read-only Collection of {@link Option} objects in this descriptor
      */
-    public Collection getOptions()
+    public Collection<Option> getOptions()
     {
         return Collections.unmodifiableCollection(helpOptions());
     }
@@ -180,9 +180,9 @@ public class Options implements Serializ
      *
      * @return the List of Options
      */
-    List helpOptions()
+    List<Option> helpOptions()
     {
-        return new ArrayList(shortOpts.values());
+        return new ArrayList<Option>(shortOpts.values());
     }
 
     /**
@@ -208,10 +208,10 @@ public class Options implements Serializ
 
         if (shortOpts.containsKey(opt))
         {
-            return (Option) shortOpts.get(opt);
+            return shortOpts.get(opt);
         }
 
-        return (Option) longOpts.get(opt);
+        return longOpts.get(opt);
     }
 
     /**
@@ -221,21 +221,17 @@ public class Options implements Serializ
      * @return the options matching the partial name specified, or an empty list if none
matches
      * @since 1.3
      */
-    public List getMatchingOptions(String opt)
+    public List<String> getMatchingOptions(String opt)
     {
         opt = Util.stripLeadingHyphens(opt);
         
-        List matchingOpts = new ArrayList();
+        List<String> matchingOpts = new ArrayList<String>();
         
-        Iterator it = longOpts.keySet().iterator();
-        while (it.hasNext())
-        {
-            String longOpt = (String) it.next();
-            if (longOpt.startsWith(opt))
-            {
+        for (String longOpt : longOpts.keySet()) {
+            if (longOpt.startsWith(opt)) {
                 matchingOpts.add(longOpt);
             }
-        }        
+        }
         
         return matchingOpts;
     }
@@ -290,7 +286,7 @@ public class Options implements Serializ
      */
     public OptionGroup getOptionGroup(Option opt)
     {
-        return (OptionGroup) optionGroups.get(opt.getKey());
+        return optionGroups.get(opt.getKey());
     }
 
     /**



Mime
View raw message