Polish formatting in Groovy scripts

This commit is contained in:
Sam Brannen 2018-03-07 15:34:55 +01:00
parent df0b39e8ac
commit 0f5a3e2647
3 changed files with 15 additions and 12 deletions

View File

@ -5,6 +5,7 @@ import org.springframework.scripting.Calculator
class GroovyCalculator implements Calculator {
int add(int x, int y) {
return x + y;
return x + y;
}
}

View File

@ -11,14 +11,15 @@ class GroovyCallCounter implements CallCounter {
}
void before() {
count++;
count++;
}
int getCalls() {
return count;
return count;
}
void destroy() {
count = -200;
}
}

View File

@ -3,17 +3,18 @@ package org.springframework.scripting.groovy;
import org.springframework.scripting.Calculator
class DelegatingCalculator implements Calculator {
def Calculator delegate;
int add(int x, int y) {
//println "hello"
//println this.metaClass.getClass()
//println delegate.metaClass.getClass()
//delegate.metaClass.invokeMethod("add", [x,y])
delegate.callMissingMethod()
return delegate.add(x,y)
//println "hello"
//println this.metaClass.getClass()
//println delegate.metaClass.getClass()
//delegate.metaClass.invokeMethod("add", [x,y])
delegate.callMissingMethod()
return delegate.add(x,y)
}
}