Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.1.0RC1
-
Fix Version/s: 2.1.2Release
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
If I attempt to run the test suite org.grails.datastore.gorm.SimpleMapTestSuite in STS I get errors like:
groovy.lang.MissingMethodException: No signature of method: org.springframework.datastore.mapping.config.groovy.MappingConfigurationBuilder.name() is applicable for argument types: (java.util.LinkedHashMap) values: [[index:true]] Possible solutions: any(), wait(), dump(), any(groovy.lang.Closure), wait(long), each(groovy.lang.Closure) at grails.gorm.tests.Task._clinit__closure1(CircularOneToManySpec.groovy:40) at grails.gorm.tests.Task._clinit__closure1(CircularOneToManySpec.groovy) at org.springframework.datastore.mapping.config.groovy.MappingConfigurationBuilder.evaluate(MappingConfigurationBuilder.groovy:37) at org.springframework.datastore.mapping.keyvalue.mapping.config.GormKeyValueMappingFactory.createMappedForm(GormKeyValueMappingFactory.java:49) at org.springframework.datastore.mapping.keyvalue.mapping.KeyValueMappingFactory.createMappedForm(KeyValueMappingFactory.java:1) at org.springframework.datastore.mapping.model.AbstractPersistentEntity.initialize(AbstractPersistentEntity.java:83) at org.springframework.datastore.mapping.model.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:98) at org.grails.datastore.gorm.Setup.setup(Setup.groovy:23) at grails.gorm.tests.GormDatastoreSpec.setup(GormDatastoreSpec.groovy:33)
These errors don't occur when running the same test from Intellij or from the Gradle command line. The class that is causing the problem is MappingConfigurationBuilder which defines an invokeMethod implementation:
MappingConfigurationBuilder(target, Class propertyClass) { this.target = target; this.propertyClass = propertyClass } def invokeMethod(String name, args) { if(args.size()>0) { if(target.hasProperty(name)) { target[name] = args.size() == 1 ? args[0] : args } else { if(args[0] instanceof Map) { properties[name] = args[0].asType(propertyClass) } } } }
Since invokeMethod is defined method dispatch shouldn't fail like it is doing. I'm not sure what is going on here, but there seems to be some difference to running with GroovyEcilpse and running with Intellij or Gradle (both of which use stub compilers)
Issue Links
- relates to
-
GROOVY-4457
generic type declarations leaking across all files in a build
-