private void checkArgumentType(Object self, Object[] arguments) { if (arguments.length != fArgumentTypes.size()) { throw new IllegalArgumentException("Parameter count mismatch"); // $NON-NLS-1$ } EvaluationEnvironment<EClassifier, EOperation, EStructuralFeature, EClass, EObject> evalEnv = fContext.getEvaluator().getEvaluationEnvironment(); if (self != null) { EClassifier callContextType = fContextType; if (callContextType == null) { callContextType = fOwningModule; } if (!evalEnv.isKindOf(self, callContextType)) { throw new IllegalArgumentException("Invalid context instance type"); // $NON-NLS-1$ } } int argIndex = 0; for (EClassifier nextArgType : fArgumentTypes) { Object nextArg = arguments[argIndex++]; if (nextArg != null) { if (!evalEnv.isKindOf(nextArg, nextArgType)) { throw new IllegalArgumentException( "Invalid type of argument, pos = " + argIndex); // $NON-NLS-1$ } } } }