Skip to content

Commit 3b4fd8d

Browse files
authored
Merge pull request #1420 from aulea/bumpGroovy-2.5.14
Bump groovy version to 2.5.14 as is Grails 4.0.x. Fixing related comp…
2 parents 9d3738f + 6a7d088 commit 3b4fd8d

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ grailsAsyncVersion=3.3.2
1919
slf4jVersion=1.7.29
2020
junitVersion=4.12
2121
javassistVersion=3.21.0-GA
22-
groovyVersion=2.5.6
22+
groovyVersion=2.5.14

grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/Entity.groovy

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Entity<P extends Property> {
8282
return defaultSort
8383
}
8484

85-
Entity setSort(Object defaultSort) {
85+
Entity<P> setSort(Object defaultSort) {
8686
this.defaultSort = defaultSort
8787
return this
8888
}
@@ -99,7 +99,7 @@ class Entity<P extends Property> {
9999
* @param name
100100
* @return
101101
*/
102-
Entity datasource(String name) {
102+
Entity<P> datasource(String name) {
103103
this.datasources = [name]
104104
return this
105105
}
@@ -111,7 +111,7 @@ class Entity<P extends Property> {
111111
* @param name
112112
* @return
113113
*/
114-
Entity connection(String name) {
114+
Entity<P> connection(String name) {
115115
this.datasources = [name]
116116
return this
117117
}
@@ -123,7 +123,7 @@ class Entity<P extends Property> {
123123
* @param name
124124
* @return
125125
*/
126-
Entity connections(String...names) {
126+
Entity<P> connections(String...names) {
127127
connections(Arrays.asList(names))
128128
return this
129129
}
@@ -134,7 +134,7 @@ class Entity<P extends Property> {
134134
* @param name
135135
* @return
136136
*/
137-
Entity connections(List<String> names) {
137+
Entity<P> connections(List<String> names) {
138138
if(names != null && names.size() > 0) {
139139
this.datasources = names
140140
}
@@ -172,7 +172,7 @@ class Entity<P extends Property> {
172172
* @param identityConfig The id config
173173
* @return This mapping
174174
*/
175-
Entity<P> id(@DelegatesTo(P) Closure identityConfig) {
175+
Entity<P> id(@DelegatesTo(type='P') Closure identityConfig) {
176176
Property.configureExisting(
177177
getOrInitializePropertyConfig(GormProperties.IDENTITY),
178178
identityConfig
@@ -185,7 +185,7 @@ class Entity<P extends Property> {
185185
*
186186
* @param isVersioned True if a version property should be configured
187187
*/
188-
Entity version(@DelegatesTo(P) Closure versionConfig) {
188+
Entity<P> version(@DelegatesTo(type='P') Closure versionConfig) {
189189
P pc = getOrInitializePropertyConfig(GormProperties.VERSION)
190190
Property.configureExisting(pc, versionConfig)
191191
return this
@@ -196,7 +196,7 @@ class Entity<P extends Property> {
196196
*
197197
* @param isVersioned True if a version property should be configured
198198
*/
199-
Entity version(Map versionConfig) {
199+
Entity<P> version(Map versionConfig) {
200200
P pc = getOrInitializePropertyConfig(GormProperties.VERSION)
201201
Property.configureExisting(pc, versionConfig)
202202
return this
@@ -207,7 +207,7 @@ class Entity<P extends Property> {
207207
*
208208
* @param tenantIdProperty The tenant id property
209209
*/
210-
Entity tenantId(String tenantIdProperty) {
210+
Entity<P> tenantId(String tenantIdProperty) {
211211
P pc = getOrInitializePropertyConfig(GormProperties.TENANT_IDENTITY)
212212
pc.name = tenantIdProperty
213213
return this
@@ -218,7 +218,7 @@ class Entity<P extends Property> {
218218
* @param propertyConfig The property config
219219
* @return This mapping
220220
*/
221-
Entity property(String name, @DelegatesTo(P) Closure propertyConfig) {
221+
Entity<P> property(String name, @DelegatesTo(type='P') Closure propertyConfig) {
222222
P pc = getOrInitializePropertyConfig(name)
223223
Property.configureExisting(pc, propertyConfig)
224224
return this
@@ -230,7 +230,7 @@ class Entity<P extends Property> {
230230
* @param propertyConfig The property config
231231
* @return This mapping
232232
*/
233-
Entity property(String name, Map propertyConfig) {
233+
Entity<P> property(String name, Map propertyConfig) {
234234
P pc = getOrInitializePropertyConfig(name)
235235
Property.configureExisting(pc, propertyConfig)
236236
return this
@@ -242,7 +242,7 @@ class Entity<P extends Property> {
242242
* @param propertyConfig The property config
243243
* @return This mapping
244244
*/
245-
P property(@DelegatesTo(P) Closure propertyConfig) {
245+
P property(@DelegatesTo(type='P') Closure propertyConfig) {
246246
if(propertyConfigs.containsKey('*')) {
247247
P cloned = cloneGlobalConstraint()
248248
return Property.configureExisting(cloned, propertyConfig)
@@ -277,7 +277,7 @@ class Entity<P extends Property> {
277277
* @param config The configuration
278278
* @return The new instance
279279
*/
280-
static <T extends Entity> T configureExisting(T mapping, @DelegatesTo(T) Closure config) {
280+
static <T extends Entity> T configureExisting(@DelegatesTo.Target T mapping, @DelegatesTo(genericTypeIndex = 0) Closure config) {
281281
config.setDelegate(mapping)
282282
config.setResolveStrategy(Closure.DELEGATE_ONLY)
283283
config.call()
@@ -288,7 +288,7 @@ class Entity<P extends Property> {
288288
if(val instanceof Closure) {
289289
property(name, (Closure)val)
290290
}
291-
else if(val instanceof P) {
291+
else if(val instanceof Property) {
292292
propertyConfigs[name] =((P)val)
293293
}
294294
else {
@@ -302,7 +302,7 @@ class Entity<P extends Property> {
302302
if(args[0] instanceof Closure) {
303303
property(name, (Closure)args[0])
304304
}
305-
else if(args[0] instanceof P) {
305+
else if(args[0] instanceof Property) {
306306
propertyConfigs[name] = (P)args[0]
307307
}
308308
else if(args[0] instanceof Map) {

grails-datastore-gorm-rx/src/main/groovy/org/grails/datastore/rx/query/RxQueryUtils.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ class RxQueryUtils {
4444
List<String> joinedProperties = []
4545
observable = observable.switchMap { Object o ->
4646

47-
List<Observable> observables = [Observable.just(o)]
47+
List<Observable<?>> observables = []
48+
observables.add Observable.just(o)
49+
4850
if(entity.isInstance(o)) {
4951

5052
for(fetch in fetchStrategies) {

0 commit comments

Comments
 (0)