protected void invokeMethod(String methodName, ICompletionProposalAcceptor acceptor, Object... params) { PolymorphicDispatcher<Void> dispatcher = dispatchers.get(methodName); if (dispatcher == null) { ErrorHandler<Void> errorHandler = WarningErrorHandler.get(log); dispatcher = new PolymorphicDispatcher<Void>(methodName, params.length + 1, params.length + 1, Collections.singletonList(this), errorHandler) { @Override public Class<?> getDefaultClass(int paramIndex) { if (paramIndex == 0) return EObject.class; return super.getDefaultClass(paramIndex); } }; dispatchers.put(methodName, dispatcher); } Object[] paramAsArray = new Object[params.length + 1]; System.arraycopy(params, 0, paramAsArray, 0, params.length); paramAsArray[params.length] = acceptor; if (handledArguments.add(Lists.asList(methodName, paramAsArray))) { dispatcher.invoke(paramAsArray); } }