use of org.eclipse.jdt.internal.compiler.problem.AbortCompilation in project xtext-eclipse by eclipse.
the class JdtBasedTypeFactory method setParameterNamesAndAnnotations.
private void setParameterNamesAndAnnotations(IMethodBinding method, ITypeBinding[] parameterTypes, String[] parameterNames, JvmExecutable result) {
InternalEList<JvmFormalParameter> parameters = (InternalEList<JvmFormalParameter>) result.getParameters();
for (int i = 0; i < parameterTypes.length; i++) {
IAnnotationBinding[] parameterAnnotations;
try {
parameterAnnotations = method.getParameterAnnotations(i);
} catch (AbortCompilation aborted) {
parameterAnnotations = null;
}
ITypeBinding parameterType = parameterTypes[i];
String parameterName = parameterNames == null ? null : /* lazy */
i < parameterNames.length ? parameterNames[i] : "arg" + i;
JvmFormalParameter formalParameter = createFormalParameter(parameterType, parameterName, parameterAnnotations);
parameters.addUnique(formalParameter);
}
}
use of org.eclipse.jdt.internal.compiler.problem.AbortCompilation in project xtext-eclipse by eclipse.
the class JdtBasedTypeFactory method createAnnotationValues.
protected void createAnnotationValues(IBinding annotated, JvmAnnotationTarget result) {
try {
resolveAnnotations.start();
IAnnotationBinding[] annotationBindings = annotated.getAnnotations();
if (annotationBindings.length != 0) {
InternalEList<JvmAnnotationReference> annotations = (InternalEList<JvmAnnotationReference>) result.getAnnotations();
for (IAnnotationBinding annotation : annotationBindings) {
annotations.addUnique(createAnnotationReference(annotation));
}
}
} catch (AbortCompilation aborted) {
if (aborted.problem.getID() == IProblem.IsClassPathCorrect) {
// ignore
} else {
log.info("Couldn't resolve annotations of " + annotated, aborted);
}
} finally {
resolveAnnotations.stop();
}
}
Aggregations