-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Description
It appears the argument validation logic in RuntimeUtils.msg(...) might be faulty:
Java-Objective-C-Bridge/src/main/java/ca/weblite/objc/RuntimeUtils.java
Lines 587 to 589 in 473221a
| if ( numArgs ==2 && numArgs != args.length+2 ){ | |
| throw new RuntimeException("Wrong argument count. The selector "+selName(selector)+" requires "+(numArgs-2)+" arguments, but received "+args.length); | |
| } |
I am not really familiar with this project, but I assume it should check for numArgs >= 2 (instead of == 2)?
Otherwise the calculation numArgs-2 in the error message is redundant because it would always be 0.
It might also be good to throw a more specific exception, e.g. IllegalArgumentException.
(Same for the other methods throwing RuntimeException when illegal arguments are provided)
Metadata
Metadata
Assignees
Labels
No labels