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 { class GroovyCalculator implements Calculator {
int add(int x, int y) { int add(int x, int y) {
return x + y; return x + y;
} }
} }

View File

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

View File

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