protected Object safeCall(Closure closure, Object... args) { try { return closure.call(args); } catch (Exception err) { typeCheckingVisitor.getSourceUnit().addException(err); return null; } }
@Override public void call(final SourceUnit source, final GeneratorContext context, final ClassNode node) throws CompilationFailedException { try { stubGenerator.generateClass(node); stubCount++; } catch (FileNotFoundException e) { source.addException(e); } } }, Phases.CONVERSION);
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException { try { if (!javaSources.isEmpty()) stubGenerator.generateClass(classNode); } catch (FileNotFoundException fnfe) { source.addException(fnfe); } } }, Phases.CONVERSION);
private List<String> getTransformClassNames(AnnotationNode annotation, Annotation transformClassAnnotation) { List<String> result = new ArrayList<String>(); try { Method valueMethod = transformClassAnnotation.getClass().getMethod("value"); String[] names = (String[]) valueMethod.invoke(transformClassAnnotation); result.addAll(Arrays.asList(names)); Method classesMethod = transformClassAnnotation.getClass().getMethod("classes"); Class[] classes = (Class[]) classesMethod.invoke(transformClassAnnotation); for (Class klass : classes) { result.add(klass.getName()); } if (names.length > 0 && classes.length > 0) { source.getErrorCollector().addError(new SimpleMessage("@GroovyASTTransformationClass in " + annotation.getClassNode().getName() + " should specify transforms only by class names or by classes and not by both", source)); } } catch (Exception e) { source.addException(e); } return result; } }
source.addException(re);
sourceUnit.addException(e);
private String[] getTransformClassNames(Annotation transformClassAnnotation) { try { Method valueMethod = transformClassAnnotation.getClass().getMethod("value"); return (String[]) valueMethod.invoke(transformClassAnnotation); } catch (Exception e) { source.addException(e); return new String[0]; } }
private String[] getTransformClasses(Annotation transformClassAnnotation) { try { Method valueMethod = transformClassAnnotation.getClass().getMethod("value"); return (String[]) valueMethod.invoke(transformClassAnnotation); } catch (Exception e) { source.addException(e); return new String[0]; } } }
private Class[] getTransformClasses(Annotation transformClassAnnotation) { try { Method classesMethod = transformClassAnnotation.getClass().getMethod("classes"); return (Class[]) classesMethod.invoke(transformClassAnnotation); } catch (Exception e) { source.addException(e); return new Class[0]; } } }
@Override @SuppressWarnings("unchecked") public void process(@Nonnull ClassLoader classLoader, @Nonnull Class<?> type, @Nonnull String line) { String[] parts = line.trim().split("="); String annotationClassName = parts[0].trim(); String transformationClassName = parts[1].trim(); try { Class<?> transformationClass = classLoader.loadClass(transformationClassName); transformations.put(annotationClassName, (Class<? extends ASTTransformation>) transformationClass); } catch (Exception e) { source.addException(e); } } });
@Override public void call(final SourceUnit source, final GeneratorContext context, final ClassNode node) throws CompilationFailedException { try { stubGenerator.generateClass(node); stubCount++; } catch (FileNotFoundException e) { source.addException(e); } } },Phases.CONVERSION);
public void call(final SourceUnit source, final GeneratorContext context, final ClassNode node) throws CompilationFailedException { if (haveJavaSources()) { try { generator.generateClass(node); } catch (Exception e) { source.addException(e); } } } }
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException { try { if (javaSources.size() != 0) stubGenerator.generateClass(classNode); } catch (FileNotFoundException fnfe) { source.addException(fnfe); } } },Phases.CONVERSION);
@Override public void call(final SourceUnit source, final GeneratorContext context, final ClassNode node) throws CompilationFailedException { try { stubGenerator.generateClass(node); stubCount++; } catch (FileNotFoundException e) { source.addException(e); } } },Phases.CONVERSION);
public void call(final SourceUnit source, final GeneratorContext context, final ClassNode node) throws CompilationFailedException { if (haveJavaSources()) { try { generator.generateClass(node); } catch (Exception e) { source.addException(e); } } } }
public void call(final SourceUnit source, final GeneratorContext context, final ClassNode node) throws CompilationFailedException { if (haveJavaSources()) { try { generator.generateClass(node); } catch (Exception e) { source.addException(e); } } } }
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException { try { if (javaSources.size() != 0) stubGenerator.generateClass(classNode); } catch (FileNotFoundException fnfe) { source.addException(fnfe); } } },Phases.CONVERSION);
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException { try { if (javaSources.size() != 0) stubGenerator.generateClass(classNode); } catch (FileNotFoundException fnfe) { source.addException(fnfe); } } },Phases.CONVERSION);
@Override public void call(final SourceUnit source, final GeneratorContext context, final ClassNode node) throws CompilationFailedException { try { stubGenerator.generateClass(node); stubCount++; } catch (FileNotFoundException e) { source.addException(e); } } },Phases.CONVERSION);
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException { try { if (javaSources.size() != 0) stubGenerator.generateClass(classNode); } catch (FileNotFoundException fnfe) { source.addException(fnfe); } } },Phases.CONVERSION);