()
| 2006 | } |
| 2007 | |
| 2008 | public Object eval() { |
| 2009 | try |
| 2010 | { |
| 2011 | Object targetval = target.eval(); |
| 2012 | Object[] argvals = new Object[args.count()]; |
| 2013 | for(int i = 0; i < args.count(); i++) |
| 2014 | argvals[i] = ((Expr) args.nth(i)).eval(); |
| 2015 | if(method != null) |
| 2016 | { |
| 2017 | LinkedList ms = new LinkedList(); |
| 2018 | ms.add(method); |
| 2019 | return Reflector.invokeMatchingMethod(methodName, ms, targetval, argvals); |
| 2020 | } |
| 2021 | if(qualifyingClass != null) |
| 2022 | return Reflector.invokeInstanceMethodOfClass(targetval, qualifyingClass, methodName, argvals); |
| 2023 | else |
| 2024 | return Reflector.invokeInstanceMethod(targetval, methodName, argvals); |
| 2025 | } |
| 2026 | catch(Throwable e) |
| 2027 | { |
| 2028 | if(!(e instanceof CompilerException)) |
| 2029 | throw new CompilerException(source, line, column, null, CompilerException.PHASE_EXECUTION, e); |
| 2030 | else |
| 2031 | throw (CompilerException) e; |
| 2032 | } |
| 2033 | } |
| 2034 | |
| 2035 | public boolean canEmitPrimitive(){ |
| 2036 | return method != null && Util.isPrimitive(method.getReturnType()); |
nothing calls this directly
no test coverage detected