@Test public void testInitInterpreterThrowsNullPointerException1() throws Throwable { BSHMethod bSHMethod = new BSHMethod("testBSHMethodBshData", true); try { bSHMethod.initInterpreter(null); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.util.Map.entrySet()\" because \"arguments\" is null", ex.getMessage(), "ex.getMessage()"); } } }
protected Interpreter initInterpreter(Map arguments) throws EvalError, IOException { Interpreter i = new Interpreter(); Map.Entry entry; for (Object o : arguments.entrySet()) { entry = (Map.Entry) o; i.set((String) entry.getKey(), entry.getValue()); } if (source) { i.source(bshData); } else { i.eval(bshData); } return i; }
BSHMethod { protected Interpreter initInterpreter(Map arguments) throws EvalError, IOException { Interpreter i = new Interpreter(); Map.Entry entry; for (Object o : arguments.entrySet()) { entry = (Map.Entry) o; i.set((String) entry.getKey(), entry.getValue()); } if (source) { i.source(bshData); } else { i.eval(bshData); } return i; } }
BSHMethod { protected Interpreter initInterpreter(Map arguments) throws EvalError, IOException { Interpreter i = new Interpreter(); Map.Entry entry; for (Object o : arguments.entrySet()) { entry = (Map.Entry) o; i.set((String) entry.getKey(), entry.getValue()); } if (source) { i.source(bshData); } else { i.eval(bshData); } return i; } BSHMethod(String bshData, boolean source); }
BSHMethod { protected Interpreter initInterpreter(Map arguments) throws EvalError, IOException { Interpreter i = new Interpreter(); Map.Entry entry; for (Object o : arguments.entrySet()) { entry = (Map.Entry) o; i.set((String) entry.getKey(), entry.getValue()); } if (source) { i.source(bshData); } else { i.eval(bshData); } return i; } BSHMethod(String bshData, boolean source); static BSHMethod createBshMethod(Element e); Object execute(Map arguments, String resultName); Map execute(Map arguments, Collection returnNames); String toString(); }
BSHMethod { protected Interpreter initInterpreter(Map arguments) throws EvalError, IOException { Interpreter i = new Interpreter(); Map.Entry entry; for (Object o : arguments.entrySet()) { entry = (Map.Entry) o; i.set((String) entry.getKey(), entry.getValue()); } if (source) { i.source(bshData); } else { i.eval(bshData); } return i; } BSHMethod(String bshData, boolean source); static BSHMethod createBshMethod(Element e); Object execute(Map arguments, String resultName); Map execute(Map arguments, Collection returnNames); String toString();  }