@Test public void testTooManyArguments () { try { new MyFunction ().checkNrOfArgsAndExecute (new String[] { "x", "y"}); fail ("no exception"); } catch (ExecutionException ee) { } }
public final String checkNrOfArgsAndExecute (String[] args) { if (args.length != mNrOfParams) { throw new ExecutionException ("function '%s' needs %d arguments, got %d", getName (), mNrOfParams, args.length); } return execute (args); }
Function { public final String checkNrOfArgsAndExecute (String[] args) { if (args.length != mNrOfParams) { throw new ExecutionException ("function '%s' needs %d arguments, got %d", getName (), mNrOfParams, args.length); } return execute (args); } }
Function { public final String checkNrOfArgsAndExecute (String[] args) { if (args.length != mNrOfParams) { throw new ExecutionException ("function '%s' needs %d arguments, got %d", getName (), mNrOfParams, args.length); } return execute (args); } Function(String name, int nrOfParameters); }
Function { public final String checkNrOfArgsAndExecute (String[] args) { if (args.length != mNrOfParams) { throw new ExecutionException ("function '%s' needs %d arguments, got %d", getName (), mNrOfParams, args.length); } return execute (args); } Function(String name, int nrOfParameters); static void setRunTime(RunTime runTime); final String getName(); final int getNrOfParameters(); final String checkNrOfArgsAndExecute(String[] args); abstract String execute(String[] args); }
Function { public final String checkNrOfArgsAndExecute (String[] args) { if (args.length != mNrOfParams) { throw new ExecutionException ("function '%s' needs %d arguments, got %d", getName (), mNrOfParams, args.length); } return execute (args); } Function(String name, int nrOfParameters); static void setRunTime(RunTime runTime); final String getName(); final int getNrOfParameters(); final String checkNrOfArgsAndExecute(String[] args); abstract String execute(String[] args);  }