public void testAmazed() { MVEL.COMPILER_OPT_ALLOW_NAKED_METH_CALL = true; try { ParserContext context = new ParserContext(); context.setStrongTyping(true); context.addInput("this", Amazed1.class); ExecutableStatement stmt = (ExecutableStatement) MVEL.compileExpression("list.size", context); Amazed1 a1 = new Amazed1(); assertEquals(new Integer(0), MVEL.executeExpression(stmt, a1)); context = new ParserContext(); context.setStrongTyping(true); context.addInput("this", Amazed2.class); stmt = (ExecutableStatement) MVEL.compileExpression("list.size", context); Amazed2 a2 = new Amazed2(); assertEquals(new Integer(0), MVEL.executeExpression(stmt, a2)); } finally { MVEL.COMPILER_OPT_ALLOW_NAKED_METH_CALL = false; } } }