File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
main/java/com/github/underscore/lodash
test/java/com/github/underscore/lodash Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1136,6 +1136,8 @@ public static <T extends Number> T subtract(final T ... values) {
11361136 result = add (result , (T ) Long .valueOf (values [i ].longValue () * -1 ));
11371137 } else if (result instanceof Short ) {
11381138 result = add (result , (T ) Short .valueOf ((short ) (values [i ].shortValue () * -1 )));
1139+ } else {
1140+ throw new UnsupportedOperationException ("Subtract only supports official subclasses of Number" );
11391141 }
11401142 }
11411143 return result ;
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ public void subtract() {
276276 assertEquals (null , U .subtract ());
277277 }
278278
279- @ Test
279+ @ Test ( expected = UnsupportedOperationException . class )
280280 public void subtractError () {
281281 class MyNumber extends Number {
282282 public int intValue () {
You can’t perform that action at this time.
0 commit comments