Skip to content

Commit 727a468

Browse files
author
graeme
committed
fix for failing test
git-svn-id: https://svn.codehaus.org/grails/trunk@5750 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent f8f392f commit 727a468

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

src/groovy/org/codehaus/groovy/grails/plugins/web/filters/DefaultGrailsFiltersClass.groovy

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,32 @@ class DefaultGrailsFiltersClass extends AbstractInjectableGrailsClass implement
4242

4343
return loader.filters;
4444
}
45+
}
46+
class Loader {
47+
def filters = []
48+
49+
def methodMissing(String name, args) {
50+
if(args) {
4551

46-
static {
47-
Loader.metaClass.methodMissing = { String methodName, args ->
48-
if(args) {
49-
50-
def fc = new FilterConfig(name:methodName)
51-
delegate.filters << fc
52+
def fc = new FilterConfig(name:methodName)
53+
delegate.filters << fc
5254

53-
if(args[0] instanceof Closure) {
54-
def closure = args[0]
55+
if(args[0] instanceof Closure) {
56+
def closure = args[0]
57+
closure.delegate = fc
58+
closure.call()
59+
}
60+
else if(args[0] instanceof Map) {
61+
fc.scope = args[0]
62+
if(args.size() > 1 && args[1] instanceof Closure) {
63+
def closure = args[1]
5564
closure.delegate = fc
65+
closure.resolveStrategy = Closure.DELEGATE_FIRST
5666
closure.call()
5767
}
58-
else if(args[0] instanceof Map) {
59-
fc.scope = args[0]
60-
if(args.size() > 1 && args[1] instanceof Closure) {
61-
def closure = args[1]
62-
closure.delegate = fc
63-
closure.resolveStrategy = Closure.DELEGATE_FIRST
64-
closure.call()
65-
}
66-
}
6768
}
68-
}
69-
}
70-
}
71-
72-
class Loader {
73-
def filters = []
69+
}
70+
}
7471
}
7572

7673

0 commit comments

Comments
 (0)