Skip to content

Commit 43a7d3f

Browse files
authored
get method on lazy test resource (#72)
1 parent 338ecf1 commit 43a7d3f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

webtau-groovy/src/main/groovy/com/twosigma/webtau/data/LazyTestResource.groovy

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ class LazyTestResource<E> {
2929
}
3030

3131
def getProperty(String name) {
32-
synchronized (this) {
33-
if (this.@originalCache == null) {
34-
this.@originalCache = this.@originalSupplier.get()
35-
}
32+
return get()."$name"
33+
}
3634

37-
return this.@originalCache."$name"
35+
synchronized E get() {
36+
if (this.@originalCache == null) {
37+
this.@originalCache = this.@originalSupplier.get()
3838
}
39+
40+
return this.@originalCache
3941
}
4042
}

0 commit comments

Comments
 (0)