Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
013cb13
canary: test Groovy 6.0.0-SNAPSHOT
jamesfredley Apr 5, 2026
4463494
fix: Groovy 6 VerifyError in DefaultConstraintFactory default parameter
jamesfredley Apr 5, 2026
ba0df88
Merge branch 'grails8-groovy5-sb4' into grails8-groovy6-canary
jamesfredley Apr 6, 2026
c19037d
fix: Groovy 6 compile fixes - Spock version check and CycloneDX license
jamesfredley Apr 6, 2026
ddd7325
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
jamesfredley Apr 6, 2026
0dcb652
fix: Groovy 6 genericGetMethod regression breaks property access on G…
jamesfredley Apr 6, 2026
a6d06f5
fix: GormEntity.get(String) throws MissingPropertyException when GORM…
jamesfredley Apr 6, 2026
99bf0be
fix: centralize Spock version check and add jline 4.0.7 CycloneDX ove…
jamesfredley Apr 6, 2026
8e4fba5
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
jamesfredley Apr 6, 2026
cfd7605
fix: Groovy 6 remaining test fixes
jamesfredley Apr 6, 2026
b2bd213
fix: resolve all remaining test failures on Groovy 6
jamesfredley Apr 6, 2026
24eb53d
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
jamesfredley Apr 6, 2026
027c203
fix: CodeNarc UnnecessaryDotClass in DefaultConstraintFactory
jamesfredley Apr 6, 2026
b225663
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
jamesfredley Apr 6, 2026
b9ac44c
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
jamesfredley Apr 6, 2026
52aad53
fix: GormEntity.get(String) delegates to staticPropertyMissing for GO…
jamesfredley Apr 6, 2026
ea41a40
Merge branch 'grails8-groovy5-sb4' into grails8-groovy6-canary
jamesfredley Apr 25, 2026
678bdf1
fix: harden Groovy 6 canary against snapshot drift and add regression…
jamesfredley Apr 25, 2026
c2aa269
fix: Groovy 6 closure dispatch regression in ControllerActionTransformer
jamesfredley Apr 25, 2026
8e9cdbc
fix: move Groovy 6 generic-getter guard from GormEntity trait to AST
jamesfredley Apr 25, 2026
ddc7ea2
fix: serialise GSP compilation under Groovy 6 to dodge ListHashMap race
jamesfredley Apr 25, 2026
95e9212
style: drop a leftover consecutive blank line in GormEntity
jamesfredley Apr 25, 2026
54b718b
fix(sbom): revert LICENSE_GROUP_MAPPING per @jdaugherty review
jamesfredley Apr 25, 2026
2619635
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
jamesfredley Apr 25, 2026
48598b4
test(forge): capture both stdout and stderr from generated-app gradle…
jamesfredley Apr 25, 2026
5d71eb4
fix(forge): bypass Spock Groovy-version check in generated app build.…
jamesfredley Apr 25, 2026
18b9e52
fix: serialise GSON/views template compilation under Groovy 6
jamesfredley Apr 25, 2026
3e9f517
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
jamesfredley Apr 25, 2026
de1cf4a
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
jamesfredley Apr 25, 2026
8af3b23
docs: drop incorrect GROOVY-11829 citation from GormEntity workaround…
jamesfredley Apr 26, 2026
3f485f3
Merge grails8-groovy5-sb4 audit work into grails8-groovy6-canary
jamesfredley Apr 27, 2026
ee77652
Add standalone reproducer link to GormEntity get(String) AST shim
jamesfredley Apr 27, 2026
fb717d3
Validateable: link standalone reproducer for the TraitReceiverTransfo…
jamesfredley Apr 27, 2026
e7f2478
Merge grails8-groovy5-sb4: link reproducer + Validateable javadoc + r…
jamesfredley Apr 27, 2026
e6332ed
ContainerSupport: link upstream PR #2495 (GROOVY-11968) and standalon…
jamesfredley Apr 27, 2026
367dad7
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
May 2, 2026
2a5e983
drop Groovy 6 workarounds whose upstream fixes have merged
May 2, 2026
4a51898
fix: workaround Groovy 6 stub generator regression in HibernateSettings
May 2, 2026
449c766
Merge branch 'grails8-groovy5-sb4' into grails8-groovy6-canary
jamesfredley May 2, 2026
a69a157
Merge remote-tracking branch 'origin/grails8-groovy5-sb4' into grails…
jamesfredley May 3, 2026
bd7a30a
Drop two more Groovy 6 workarounds - upstream fixes merged 2026-05-02
jamesfredley May 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class CompilePlugin implements Plugin<Project> {
it.options.encoding = StandardCharsets.UTF_8.name()
it.options.fork = true
it.options.forkOptions.jvmArgs = ['-Xms128M', '-Xmx2G']
it.options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
if (System.getenv('SUPPRESS_DEPRECATION_WARNINGS') == 'true') {
it.options.compilerArgs += ['-Xlint:-removal']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ class SbomPlugin implements Plugin<Project> {
'pkg:maven/com.oracle.coherence.ce/coherence-bom@25.03.1?type=pom': 'UPL-1.0', // does not have map based on license id
'pkg:maven/com.oracle.coherence.ce/coherence-bom@25.03.2?type=pom': 'UPL-1.0', // does not have map based on license id
'pkg:maven/com.oracle.coherence.ce/coherence-bom@22.06.2?type=pom': 'UPL-1.0', // does not have map based on license id
'pkg:maven/jline/jline@2.14.6?type=jar' : 'BSD-2-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/jline/jline@2.14.6?type=jar' : 'BSD-2-Clause', // legacy jline:jline group, BSD-2; maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/opensymphony/sitemesh@2.6.0?type=jar' : 'OpenSymphony', // custom license approved by legal LEGAL-707
'pkg:maven/org.antlr/antlr4-runtime@4.7.2?type=jar' : 'BSD-3-Clause', // maps incorrectly because of https://github.com/CycloneDX/cyclonedx-core-java/issues/205
'pkg:maven/org.jline/jansi@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jline@3.30.6?type=jar' : 'BSD-3-Clause', // direct dependency declared at jline.version in dependencies.gradle
'pkg:maven/org.jline/jline-builtins@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jline-console@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jline-native@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jline-reader@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jline-style@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jline-terminal@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jline-terminal-jansi@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jline-terminal-jna@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jline-terminal-jni@3.30.9?type=jar' : 'BSD-3-Clause', // jline group resolved at 3.30.9 transitively via groovy-groovysh; main org.jline:jline pinned at 3.30.6 directly
'pkg:maven/org.jline/jansi@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; cyclonedx misreports as BSD-4-Clause (cyclonedx-core-java#205); resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jline/jline@3.30.6?type=jar' : 'BSD-3-Clause', // jline 3.30.6 LICENSE at https://github.com/jline/jline3/blob/jline-parent-3.30.6/LICENSE.txt confirms BSD-3-Clause; direct dependency declared at jline.version in dependencies.gradle
'pkg:maven/org.jline/jline-builtins@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jline/jline-console@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jline/jline-console-ui@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jline/jline-native@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jline/jline-reader@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jline/jline-shell@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jline/jline-style@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jline/jline-terminal@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jline/jline-terminal-jni@4.0.12?type=jar' : 'BSD-3-Clause', // jline 4.0.12 LICENSE.txt at https://github.com/jline/jline3/blob/jline-parent-4.0.12/LICENSE.txt confirms BSD-3-Clause; resolved transitively via groovy-groovysh on Groovy 6
'pkg:maven/org.jruby/jzlib@1.1.5?type=jar' : 'BSD-3-Clause', // https://web.archive.org/web/20240822213507/http://www.jcraft.com/jzlib/LICENSE.txt shows it's a 3 clause
'pkg:maven/org.liquibase.ext/liquibase-hibernate5@4.27.0?type=jar': 'Apache-2.0', // maps incorrectly because of https://github.com/liquibase/liquibase/issues/2445 & the base pom does not define a license
]
Expand Down
6 changes: 3 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ext {
'commons-codec.version' : '1.21.0',
'commons-lang3.version' : '3.20.0',
'geb-spock.version' : '8.0.1',
'groovy.version' : '5.0.6-SNAPSHOT',
'groovy.version' : '6.0.0-SNAPSHOT',
'hibernate-groovy-proxy.version': '1.1',
'jakarta-servlet-api.version' : '6.1.0',
'jakarta-validation.version' : '3.1.1',
Expand Down Expand Up @@ -217,9 +217,9 @@ ext {
else if (project.name == 'grails-micronaut-bom') {
customBomVersions = [
// Keep aligned with bomDependencyVersions['groovy.version']; the main bom now uses
// Groovy 5, so the micronaut bom must match to avoid validateDependencyVersions
// Groovy 6, so the micronaut bom must match to avoid validateDependencyVersions
// failures from transitive dependencies upgrading groovy-bom past the pinned version.
'groovy.version' : '5.0.6-SNAPSHOT',
'groovy.version' : '6.0.0-SNAPSHOT',
'spock.version' : '2.4-groovy-5.0',
'protobuf.version': '4.30.2',
]
Expand Down
6 changes: 1 addition & 5 deletions gradle/functional-test-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ configurations.configureEach {
}
}

tasks.named('compileTestGroovy') {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

tasks.named('compileGroovy') {
tasks.withType(GroovyCompile).configureEach {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

Expand Down
4 changes: 4 additions & 0 deletions gradle/hibernate5-test-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ dependencies {
add('testRuntimeOnly', 'org.objenesis:objenesis')
}

tasks.withType(GroovyCompile).configureEach {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

tasks.withType(Test).configureEach {
// Honor DO_NOT_CACHE_TESTS=1 so developers can repeatedly invoke the same test command
// without --rerun-tasks (and without recompiling everything else).
Expand Down
4 changes: 4 additions & 0 deletions gradle/mongodb-forked-test-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ dependencies {
add('testRuntimeOnly', 'org.objenesis:objenesis')
}

tasks.withType(GroovyCompile).configureEach {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

tasks.named('compileTestGroovy', GroovyCompile) {
groovyOptions.forkOptions.jvmArgs = ['-Xmx768m']
}
Expand Down
4 changes: 4 additions & 0 deletions gradle/mongodb-test-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ dependencies {
add('testRuntimeOnly', 'org.objenesis:objenesis')
}

tasks.withType(GroovyCompile).configureEach {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

tasks.named('compileTestGroovy', GroovyCompile) {
groovyOptions.forkOptions.jvmArgs = ['-Xmx768m']
}
Expand Down
11 changes: 6 additions & 5 deletions gradle/test-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ dependencies {
add('testRuntimeOnly', 'org.objenesis:objenesis')
}

tasks.named('compileTestGroovy') {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

tasks.named('compileGroovy') {
// Disable Spock's compile-time Groovy version check on ALL Groovy compile
// tasks. Spock's SpockTransform is registered via META-INF services and
// the Groovy compiler loads every AST transform on the classpath, so even
// main source sets trip the version check when Groovy is newer than the
// Spock artifact's groovy variant.
tasks.withType(GroovyCompile).configureEach {
options.forkOptions.jvmArgs += ['-Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true']
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
import org.codehaus.groovy.classgen.GeneratorContext;
import org.codehaus.groovy.control.CompilationUnit;
import org.codehaus.groovy.control.SourceUnit;
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import org.codehaus.groovy.syntax.Token;
import org.codehaus.groovy.syntax.Types;
import org.codehaus.groovy.transform.trait.Traits;
Expand Down Expand Up @@ -267,12 +266,12 @@ private void processMethods(ClassNode classNode, SourceUnit source,
if (methodShouldBeConfiguredAsControllerAction(method)) {
final List<MethodNode> declaredMethodsWithThisName = classNode.getDeclaredMethods(method.getName());
if (declaredMethodsWithThisName != null) {
final int numberOfNonExceptionHandlerMethodsWithThisName = DefaultGroovyMethods.count((Iterable) declaredMethodsWithThisName, new Closure(this) {
@Override
public Object call(Object object) {
return !isExceptionHandlingMethod((MethodNode) object);
int numberOfNonExceptionHandlerMethodsWithThisName = 0;
for (MethodNode candidate : declaredMethodsWithThisName) {
if (!isExceptionHandlingMethod(candidate)) {
numberOfNonExceptionHandlerMethodsWithThisName++;
}
}).intValue();
}
if (numberOfNonExceptionHandlerMethodsWithThisName > 1) {
String message = "Controller actions may not be overloaded. The [" +
method.getName() +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,33 @@ class GormEntityTransformation extends AbstractASTTransformation implements Comp
classNode.addMethod('$static_propertyMissing', Modifier.PUBLIC | Modifier.STATIC, AstUtils.OBJECT_CLASS_NODE, propertyMissingGetParameters, null, propertyMissingGetBody)
markAsGenerated(classNode, propertyMissingNodeGetter)

// INSTANCE Object get(String name) - Groovy 6 generic-getter MOP regression workaround.
// On Groovy 6, MetaClassImpl picks up the inherited GormEntity.get(Serializable)
// entity-by-ID method as the genericGetMethod for instance property access on the
// implementing class, hijacking every dynamic property read - including ones that
// should fall through to propertyMissing(String) for datasource qualifiers. Result:
// book.someConnection.delete(flush: true) silently returns the get(Serializable) value
// (an entity row or null) instead of the expected DelegatingGormEntityApi, which then
// surfaces as "Unknown entity: java.util.LinkedHashMap" deep in Hibernate or as NPEs
// in HibernateRuntimeUtils.setupErrorsProperty.
// Workaround: add an instance Object get(String) directly on every @Entity class via
// AST. Groovy's instance MOP picks the more-specific String overload over the
// inherited Serializable one, so the generic-getter winds up routing through the
// existing propertyMissing(String) and yields a DelegatingGormEntityApi as expected.
// Standalone reproducer: https://github.com/jamesfredley/groovy6-get-as-generic-getter
// No upstream Apache Groovy JIRA filed yet; remove this shim once one is filed and fixed.
def instanceGetBody = new BlockStatement()
def instanceGetNameParam = new Parameter(ClassHelper.make(String), 'name')
def instanceGetArgs = new ArgumentListExpression(instanceGetNameParam)
def instanceGetMethodCall = new MethodCallExpression(new VariableExpression('this'), 'propertyMissing', instanceGetArgs)
instanceGetBody.addStatement(
new ExpressionStatement(instanceGetMethodCall)
)
def instanceGetParameters = [instanceGetNameParam] as Parameter[]
MethodNode instanceGetNode =
classNode.addMethod('get', Modifier.PUBLIC, AstUtils.OBJECT_CLASS_NODE, instanceGetParameters, null, instanceGetBody)
markAsGenerated(classNode, instanceGetNode)

// now process named query associations
// see https://grails.apache.org/docs/latest/ref/Domain%20Classes/namedQueries.html

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import org.grails.datastore.mapping.model.types.ToOne
import org.grails.datastore.mapping.query.api.BuildableCriteria
import org.grails.datastore.mapping.query.api.Criteria
import org.grails.datastore.mapping.reflect.EntityReflector
import org.codehaus.groovy.runtime.InvokerHelper

/**
*
Expand Down Expand Up @@ -590,7 +591,22 @@ trait GormEntity<D> implements GormValidateable, DirtyCheckable, GormEntityApi<D
}

/**
* Retrieves an object from the datastore. eg. Book.get(1)
* Retrieves an object from the datastore. eg. {@code Book.get(1)}.
*
* On Groovy 6, dynamic property access on a GORM entity instance
* (e.g. {@code book.someConnection}) was being mis-routed through this
* static {@code get(Serializable)} method when it was the only candidate
* the runtime could find for the implementing class's generic-getter
* fallback - a connection-aware static API was returned where the
* entity-level {@code propertyMissing(String)} should have produced a
* {@code DelegatingGormEntityApi}, leading to "Unknown entity:
* java.util.LinkedHashMap" deep inside Hibernate. The fix is the
* per-{@code @Entity} instance overload {@code Object get(String name)}
* added by {@code GormEntityTransformation}, which gives instance MOP a
* more specific candidate than this trait-static one. There is no
* upstream Apache Groovy JIRA for the dispatch behaviour at the time of
* writing - if you find one or file one, link it from
* {@code GormEntityTransformation} too.
*/
@Generated
static D get(Serializable id) {
Expand Down Expand Up @@ -854,6 +870,10 @@ trait GormEntity<D> implements GormValidateable, DirtyCheckable, GormEntityApi<D
*/
@Generated
static Object staticPropertyMissing(String property) {
MetaProperty mp = InvokerHelper.getMetaClass(Class).hasProperty(this, property)
if (mp != null) {
return mp.getProperty(this)
}
try {
currentGormStaticApi().propertyMissing(property)
} catch (IllegalStateException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,23 @@ class GormEntityTransformSpec extends Specification{
thrown(MissingPropertyException)
}

void 'test Groovy 6 generic-getter instance-dispatch guard'() {
expect: 'Class bean properties remain accessible via dynamic property access on @Entity classes under Groovy 6'
Book.simpleName == 'Book'
Book.name.endsWith('Book')

and: 'the original get(Serializable) overload still exists for entity-by-id lookups'
def getSerializableMethod = Book.getMethod('get', Serializable)
getSerializableMethod != null
getSerializableMethod.isAnnotationPresent(Generated)

and: 'GormEntityTransformation has AST-added an INSTANCE get(String) overload to each @Entity class so instance MOP routes book.someConnection through propertyMissing instead of any trait-static get(String). Declaring it on the trait would clash with any sibling static get(String) at trait-merge time, so the AST is the only viable home. See GormEntityTransformation for the full rationale and failure mode.'
def instanceGetString = Book.getDeclaredMethod('get', String)
instanceGetString != null
!java.lang.reflect.Modifier.isStatic(instanceGetString.modifiers)
instanceGetString.isAnnotationPresent(Generated)
}

void 'test that all GormEntity/GormValidateable trait methods are marked as Generated'() {

expect: 'all GormEntity methods are marked as Generated on implementation class'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CommandSpec extends Specification {
pb.environment().put('JAVA_HOME', System.getenv('JAVA_HOME') ?: System.getProperty('java.home'))
pb.environment().put('GRAILS_REPO_URL', System.getenv('GRAILS_REPO_URL') ?: null)
process = pb.directory(dir).start()
process.consumeProcessOutputStream(output)
process.consumeProcessOutput(output, output)
process
}

Expand Down
Loading
Loading