Permalink
Browse files

<action issue="EXEC-81" dev="ggregory" type="fix" date="2014-02-04" d…

…ue-to="Stephen Compall">Remove remaining raw types, unchecked conversions</action>

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/exec/trunk@1564607 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
garydgregory committed Feb 5, 2014
1 parent f1dea18 commit ae3f40da41ef92ccfd8a39017385d3ef9ba106cf
Showing with 9 additions and 8 deletions.
  1. +9 −8 src/main/java/org/apache/commons/exec/CommandLine.java
@@ -49,7 +49,7 @@
/**
* A map of name value pairs used to expand command line arguments
*/
- private Map substitutionMap; // N.B. This can contain values other than Strings
+ private Map<String, ?> substitutionMap; // N.B. This can contain values other than Strings
/**
* Was a file being used to set the executable?
@@ -75,7 +75,7 @@ public static CommandLine parse(final String line) {
* @return the parsed command line
* @throws IllegalArgumentException If line is null or all whitespace
*/
- public static CommandLine parse(final String line, final Map substitutionMap) {
+ public static CommandLine parse(final String line, final Map<String, ?> substitutionMap) {
if (line == null) {
throw new IllegalArgumentException("Command line can not be null");
@@ -127,12 +127,13 @@ public CommandLine(final CommandLine other)
if (other.getSubstitutionMap() != null)
{
- this.substitutionMap = new HashMap();
- final Iterator iterator = other.substitutionMap.keySet().iterator();
+ Map<String, Object> omap = new HashMap<String, Object>();
+ this.substitutionMap = omap;
+ final Iterator<String> iterator = other.substitutionMap.keySet().iterator();
while (iterator.hasNext())
{
- final Object key = iterator.next();
- this.substitutionMap.put(key, other.getSubstitutionMap().get(key));
+ final String key = iterator.next();
+ omap.put(key, other.getSubstitutionMap().get(key));
}
}
}
@@ -274,7 +275,7 @@ public CommandLine addArgument(final String argument, final boolean handleQuotin
/**
* @return the substitution map
*/
- public Map getSubstitutionMap() {
+ public Map<String, ?> getSubstitutionMap() {
return substitutionMap;
}
@@ -284,7 +285,7 @@ public Map getSubstitutionMap() {
*
* @param substitutionMap the map
*/
- public void setSubstitutionMap(final Map substitutionMap) {
+ public void setSubstitutionMap(final Map<String, ?> substitutionMap) {
this.substitutionMap = substitutionMap;
}

0 comments on commit ae3f40d

Please sign in to comment.