public MethodCallersGoal(Callable callable, SearchService searchService) { this.searchService = searchService; if (callable instanceof RubyMethod) { RubyMethod method = (RubyMethod) callable; if (method.name().equals("init")) callable = method.runtimeClass().metaClass().findMethod("new"); } this.callable = callable; }
private CallC[] collectSuitableCallers(RubyMethod method) { List<CallC> realCallers = new ArrayList<CallC>(); for (int i = 0; i < constructs.length; i++) for (RubyBasicClass klass : goals[i].result(thing()).possibleClasses()) if (method.canBeCalledFrom(klass)) realCallers.add(constructs[i]); return realCallers.toArray(createArray(realCallers.size())); }