This commit is contained in:
Phillip Webb
2015-07-14 22:17:52 -07:00
parent 68d875bdc6
commit f0f5f78e25
17 changed files with 69 additions and 58 deletions

View File

@@ -35,7 +35,8 @@ class ExpressionTree extends ReflectionWrapper {
private final Class<?> methodInvocationTreeType = findClass("com.sun.source.tree.MethodInvocationTree");
private final Method methodInvocationArgumentsMethod = findMethod(this.methodInvocationTreeType, "getArguments");
private final Method methodInvocationArgumentsMethod = findMethod(
this.methodInvocationTreeType, "getArguments");
private final Class<?> newArrayTreeType = findClass("com.sun.source.tree.NewArrayTree");
@@ -59,7 +60,8 @@ class ExpressionTree extends ReflectionWrapper {
public Object getFactoryValue() throws Exception {
if (this.methodInvocationTreeType.isAssignableFrom(getInstance().getClass())) {
List<?> arguments = (List<?>) this.methodInvocationArgumentsMethod.invoke(getInstance());
List<?> arguments = (List<?>) this.methodInvocationArgumentsMethod
.invoke(getInstance());
if (arguments.size() == 1) {
return new ExpressionTree(arguments.get(0)).getLiteralValue();
}