Skip to content

Commit a6d70aa

Browse files
committed
Fix unexplainable Groovy 2.4.6 compilation errors
1 parent 66d6054 commit a6d70aa

File tree

7 files changed

+19
-8
lines changed

7 files changed

+19
-8
lines changed

grails-bootstrap/src/main/groovy/grails/codegen/model/ModelBuilder.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ trait ModelBuilder {
111111

112112
@Override
113113
Map<String, Object> asMap() {
114-
[ className: className, fullName: fullName, propertyName: propertyName, modelName: propertyName, packageName: packageName, packagePath: packagePath, simpleName: simpleName, lowerCaseName: lowerCaseName]
114+
(Map<String,Object>) [ className: className, fullName: fullName, propertyName: propertyName, modelName: propertyName, packageName: packageName, packagePath: packagePath, simpleName: simpleName, lowerCaseName: lowerCaseName]
115115
}
116116
}
117117

grails-core/src/main/groovy/grails/boot/config/GrailsAutoConfiguration.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class GrailsAutoConfiguration implements GrailsApplicationClass, ApplicationCont
118118
*/
119119
Collection<Package> packages() {
120120
def thisPackage = getClass().package
121-
thisPackage ? [ thisPackage ] : []
121+
thisPackage ? [ thisPackage ] : new ArrayList<Package>()
122122
}
123123

124124
/**

grails-plugin-async/src/main/groovy/org/grails/plugins/web/async/WebRequestPromiseDecoratorLookupStrategy.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ class WebRequestPromiseDecoratorLookupStrategy implements PromiseDecoratorLookup
3232
List<PromiseDecorator> findDecorators() {
3333
final webRequest = GrailsWebRequest.lookup()
3434
if (webRequest) {
35-
return [new WebRequestPromiseDecorator(webRequest)]
35+
List<PromiseDecorator> decorators = []
36+
decorators.add(new WebRequestPromiseDecorator(webRequest))
37+
return decorators
3638
}
3739
return Collections.emptyList()
3840
}

grails-plugin-domain-class/src/main/groovy/grails/artefact/DomainClass.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ trait DomainClass {
3737

3838
static Map<String, Constrained> getConstrainedProperties() {
3939
GrailsDomainClass domainClass = (GrailsDomainClass)Holders?.grailsApplication?.getArtefact(DomainClassArtefactHandler.TYPE, this.name)
40-
return (Map<String, Constrained>)domainClass?.getConstrainedProperties() ?: Collections.emptyMap()
40+
def constrainedProperties = domainClass?.getConstrainedProperties()
41+
if(constrainedProperties) {
42+
return constrainedProperties
43+
}
44+
else {
45+
return Collections.<String,Constrained>emptyMap()
46+
}
4147
}
4248
}

grails-plugin-events/src/main/groovy/grails/events/Events.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ trait Events {
9696
*/
9797
public <E extends Event<?> > Registration<Object, Consumer<E>> on(Selector sel, Consumer<E> consumer) {
9898
if(eventBus == null) throw new IllegalStateException("EventBus not present. Event registration attempted outside of application context.")
99-
eventBus.on sel, consumer
99+
return ( Registration<Object, Consumer<E>>) eventBus.on( sel, consumer )
100100
}
101101

102102
/**

grails-shell/src/main/groovy/org/grails/cli/profile/commands/factory/ResourceResolvingCommandFactory.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ abstract class ResourceResolvingCommandFactory<T> implements CommandFactory {
6464

6565
protected Collection<CommandResourceResolver> getCommandResolvers(boolean inherited) {
6666
def profileCommandsResolver = new FileSystemCommandResourceResolver(matchingFileExtensions)
67+
Collection<CommandResourceResolver> commandResolvers = []
6768
if(inherited) {
68-
return [profileCommandsResolver]
69+
commandResolvers.add(profileCommandsResolver)
70+
return commandResolvers
6971
}
7072
else {
7173
def localCommandsResolver1 = new FileSystemCommandResourceResolver(matchingFileExtensions) {
@@ -80,7 +82,8 @@ abstract class ResourceResolvingCommandFactory<T> implements CommandFactory {
8082
return new FileSystemResource("${BuildSettings.BASE_DIR}/commands/" )
8183
}
8284
}
83-
return [profileCommandsResolver, localCommandsResolver1, localCommandsResolver2, new ClasspathCommandResourceResolver(matchingFileExtensions) ]
85+
commandResolvers.addAll([profileCommandsResolver, localCommandsResolver1, localCommandsResolver2, new ClasspathCommandResourceResolver(matchingFileExtensions) ])
86+
return commandResolvers
8487
}
8588
}
8689

grails-web-databinding/src/main/groovy/org/grails/web/databinding/bindingsource/JsonDataBindingSourceCreator.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class JsonDataBindingSourceCreator extends AbstractRequestBodyDataBindingSourceC
8383
}
8484
return new CollectionDataBindingSource() {
8585
List<DataBindingSource> getDataBindingSources() {
86-
dataBindingSources
86+
(List<DataBindingSource>)dataBindingSources
8787
}
8888
}
8989
}

0 commit comments

Comments
 (0)