private Object callMethodWithDebugInfo(Map context, Object object, String methodName, Object[] objects) throws MethodFailedException { try { return super.callMethod(context, object, methodName, objects); } catch(MethodFailedException e) { if (LOG.isDebugEnabled()) { if (!(e.getReason() instanceof NoSuchMethodException)) { // the method exists on the target object, but something went wrong String s = "Error calling method through OGNL: object: [#0] method: [#1] args: [#2]"; LOG.debug(s, e.getReason(), object.toString(), methodName, Arrays.toString(objects)); } } throw e; } }
private Object callStaticMethodWithDebugInfo(Map context, Class aClass, String methodName, Object[] objects) throws MethodFailedException { try { return super.callStaticMethod(context, aClass, methodName, objects); } catch(MethodFailedException e) { if (LOG.isDebugEnabled()) { if (!(e.getReason() instanceof NoSuchMethodException)) { // the method exists on the target class, but something went wrong String s = "Error calling method through OGNL, class: [#0] method: [#1] args: [#2]"; LOG.debug(s, e.getReason(), aClass.getName(), methodName, Arrays.toString(objects)); } } throw e; } } }
private InvalidExpressionException invalidExpressionException(OgnlException e) { Throwable cause = e; String message = e.getMessage(); if (e.getReason() != null) { message = e.getReason().getMessage(); cause = e.getReason(); } if (message == null) { message = ""; } if (e instanceof MethodFailedException) { MethodFailedException ex = ((MethodFailedException) e); Throwable realReason = ex.getReason(); if (realReason != null) { if (realReason instanceof NullPointerException) { message = "NullPointerException"; } else { message = realReason.getClass().getName() + ": " + message; } } message = message.replaceAll("java\\.lang\\.", ""); } return new InvalidExpressionException(message, cause); }
private InvalidExpressionException invalidExpressionException(OgnlException e) { Throwable cause = e; String message = e.getMessage(); if (e.getReason() != null) { message = e.getReason().getMessage(); cause = e.getReason(); } if (message == null) { message = ""; } if (e instanceof MethodFailedException) { MethodFailedException ex = ((MethodFailedException) e); Throwable realReason = ex.getReason(); if (realReason != null) { if (realReason instanceof NullPointerException) { message = "NullPointerException"; } else { message = realReason.getClass().getName() + ": " + message; } } message = message.replaceAll("java\\.lang\\.", ""); } return new InvalidExpressionException(message, cause); }
} catch (MethodFailedException e) { if (e.getReason() instanceof NoSuchMethodException) { try { String altMethodName = "do" + methodName.substring(0, 1).toUpperCase() + methodName.substring(1) + "()"; } catch (MethodFailedException e1) { if (e1.getReason() instanceof NoSuchMethodException) { if (unknownHandlerManager.hasUnknownHandlers()) { try {