public Object invokeMethod(String name, Object args) { try { return super.invokeMethod(name, args); } catch (GroovyRuntimeException e) { // br should get a "native" property match first. getProperty includes such fall-back logic Object value = this.getProperty(name); if (value instanceof Closure) { Closure closure = (Closure) value; closure = (Closure) closure.clone(); closure.setDelegate(this); return closure.call((Object[]) args); } else { throw e; } } }
public Object invokeMethod(String name, Object args) { try { return super.invokeMethod(name, args); } catch (GroovyRuntimeException e) { // br should get a "native" property match first. getProperty includes such fall-back logic Object value = this.getProperty(name); if (value instanceof Closure) { Closure closure = (Closure) value; closure.setDelegate(this); return closure.call((Object[]) args); } else { throw e; } } }
public Object invokeMethod(String name, Object args) { try { return super.invokeMethod(name, args); } catch (GroovyRuntimeException e) { // br should get a "native" property match first. getProperty includes such fall-back logic Object value = this.getProperty(name); if (value instanceof Closure) { Closure closure = (Closure) value; closure.setDelegate(this); return closure.call((Object[]) args); } else { throw e; } } }
public Object invokeMethod(String name, Object args) { try { return super.invokeMethod(name, args); } catch (GroovyRuntimeException e) { // br should get a "native" property match first. getProperty includes such fall-back logic Object value = this.getProperty(name); if (value instanceof Closure) { Closure closure = (Closure) value; closure = (Closure) closure.clone(); closure.setDelegate(this); return closure.call((Object[]) args); } else { throw e; } } }
public Object invokeMethod(String name, Object args) { try { return super.invokeMethod(name, args); } catch (GroovyRuntimeException e) { // br should get a "native" property match first. getProperty includes such fall-back logic Object value = this.getProperty(name); if (value instanceof Closure) { Closure closure = (Closure) value; closure = (Closure) closure.clone(); closure.setDelegate(this); return closure.call((Object[]) args); } else { throw e; } } }
/** * Runs a QAvalidator analysis. * <p> * Does the exception handling. * * @param config the configuration * @return the result of the run. If the analysis fails with any kind of {@link Throwable}, a flag is set and the * message is contained in the {@link QAvalidatorResult}. */ public QAvalidatorResult runAnalysis(QAvalidatorConfig config) { QAvalidatorResult result = new QAvalidatorResult(); try { String analysisFilename = selectAnalysisFilename(config); QavAnalysisReader qavAnalysisReader = new QavAnalysisReader(analysisFilename); // may throw IllegalArgumentException qavAnalysisReader.setInputDirs(config.getInputDirs()); qavAnalysisReader.setOutputDir(config.getOutputDir()); qavAnalysisReader.setMavenDir(config.getMavenDir()); qavAnalysisReader.setMavenGroup(config.getMavenGroup()); qavAnalysisReader.read(); // actually runs the analysis @SuppressWarnings("unchecked") List<String> failedSteps = (List<String>) qavAnalysisReader.getContext().getProperty("failedSteps"); result.setFailedSteps(failedSteps); } catch (Throwable e) { result.setFailedWithException(true); result.setExceptionMessage(e.getMessage()); } return result; }