File tree Expand file tree Collapse file tree
main/java/org/apache/commons/cli
test/java/org/apache/commons/cli Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838 <action type =" add" dev =" ggregory" due-to =" Jason Dillon" issue =" CLI-276" >
3939 Adjust access-modifier of checkRequiredOptions() to protected.
4040 </action >
41+ <action type =" add" dev =" ggregory" due-to =" Alex Nordlund" issue =" CLI-282" >
42+ TypeHandler should throw ParseException for an unsupported class.
43+ </action >
4144 </release >
4245
4346 <release version =" 1.4" date =" 2017-03-09" description =" New features and bug fixes" >
Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ else if (PatternOptionBuilder.URL_VALUE == clazz)
100100 }
101101 else
102102 {
103- return null ;
103+ throw new ParseException ( "Unable to handle the class: " + clazz ) ;
104104 }
105105 }
106106
Original file line number Diff line number Diff line change @@ -148,6 +148,13 @@ public void testCreateValueURL_malformed()
148148 TypeHandler .createValue ("malformed-url" , PatternOptionBuilder .URL_VALUE );
149149 }
150150
151+ @ Test (expected = ParseException .class )
152+ public void testCreateValueInteger_failure ()
153+ throws Exception
154+ {
155+ TypeHandler .createValue ("just-a-string" , Integer .class );
156+ }
157+
151158 public static class Instantiable
152159 {
153160 }
You can’t perform that action at this time.
0 commit comments