Skip to content

Commit

Permalink
FORGE-1155: Removed unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Oct 14, 2013
1 parent 8776385 commit 805f592
Showing 1 changed file with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
package org.jboss.forge.addon.shell.aesh;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -113,31 +112,10 @@ public void validate(Object value) throws org.jboss.aesh.cl.validator.OptionVali
});
optionBuilder.converter(new CLConverter<Object>()
{
@SuppressWarnings("unchecked")
@Override
public Object convert(String value)
{
Object inputValue = InputComponents.convertToUIInputValue(converterFactory, input, value);
// Many valued elements are called one at a time, so it needs to add to the existing values
if (isMultiple)
{
Iterable<Object> iterable = (Iterable<Object>) InputComponents.getValueFor(input);
List<Object> items = new ArrayList<Object>();
if (iterable != null)
{
for (Object item : iterable)
{
items.add(item);
}
}
items.add(inputValue);
InputComponents.setValueFor(converterFactory, input, items);
}
else
{
InputComponents.setValueFor(converterFactory, input, inputValue);
}
return inputValue;
return InputComponents.convertToUIInputValue(converterFactory, input, value);
}
});
if (input.getShortName() != InputComponents.DEFAULT_SHORT_NAME)
Expand Down

0 comments on commit 805f592

Please sign in to comment.