Skip to content

Commit

Permalink
Merge pull request #174 from Villane/master
Browse files Browse the repository at this point in the history
Fix for throwing InvocationTargetException's target for no-args method.
  • Loading branch information
spullara committed Aug 10, 2016
2 parents 774ae7a + f31daa3 commit 00bd131
Showing 1 changed file with 15 additions and 8 deletions.
@@ -1,19 +1,26 @@
package com.github.mustachejava.reflect;

import static java.util.Collections.*;

import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.github.mustachejava.Binding;
import com.github.mustachejava.Code;
import com.github.mustachejava.ObjectHandler;
import com.github.mustachejava.TemplateContext;
import com.github.mustachejava.reflect.guards.*;
import com.github.mustachejava.reflect.guards.ClassGuard;
import com.github.mustachejava.reflect.guards.DepthGuard;
import com.github.mustachejava.reflect.guards.DotGuard;
import com.github.mustachejava.reflect.guards.MapGuard;
import com.github.mustachejava.reflect.guards.NullGuard;
import com.github.mustachejava.reflect.guards.WrappedGuard;
import com.github.mustachejava.util.GuardException;
import com.github.mustachejava.util.Wrapper;

import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
import java.util.*;

import static java.util.Collections.singletonList;

/**
* Lookup objects using reflection and execute them the same way.
*
Expand Down Expand Up @@ -144,7 +151,7 @@ protected Wrapper findWrapper(final int scopeIndex, Wrapper[] wrappers, List<Gua
}
}
AccessibleObject member = findMember(scope.getClass(), name);
return member == null ? null : createWrapper(scopeIndex, wrappers, guards, member, null);
return member == null ? null : createWrapper(scopeIndex, wrappers, guards, member, new Object[0]);
}

// Factories
Expand Down

0 comments on commit 00bd131

Please sign in to comment.