matrei commented on code in PR #15683:
URL: https://github.com/apache/grails-core/pull/15683#discussion_r3330744820
##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/base/GrailsDataTckManager.groovy:
##########
@@ -56,34 +56,25 @@ abstract class GrailsDataTckManager {
abstract Session createSession()
- List<Class> domainClasses = [
- Book,
- ChildEntity,
- City,
- ClassWithListArgBeforeValidate,
- ClassWithNoArgBeforeValidate,
- ClassWithOverloadedBeforeValidate,
- CommonTypes,
- Country,
- EnumThing,
- Face,
- Highway,
- Location,
- ModifyPerson,
- Nose,
- OptLockNotVersioned,
- OptLockVersioned,
- Person,
- PersonEvent,
- Pet,
- PetType,
- Plant,
- PlantCategory,
- Publication,
- Task,
- TestEntity
+ private List<Class> domainClasses = [
]
+ /**
+ * Returns an unmodifiable view of the domain classes list.
+ * @return An unmodifiable list of domain classes
+ */
+ List<Class> getDomainClasses() {
+ return Collections.unmodifiableList(domainClasses)
+ }
+
+ /**
+ * Adds all the specified classes to the domain classes list.
+ * @param classes The classes to add
+ */
+ void addAllDomainClasses(Collection<Class> classes) {
Review Comment:
Could we name this method `addDomainClasses` or `registerDomainClasses`?
Could we make the parameter a vararg: `void addDomainClasses(Class...
domainClasses)`?
##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/base/GrailsDataTckManager.groovy:
##########
@@ -56,34 +56,25 @@ abstract class GrailsDataTckManager {
abstract Session createSession()
- List<Class> domainClasses = [
- Book,
- ChildEntity,
- City,
- ClassWithListArgBeforeValidate,
- ClassWithNoArgBeforeValidate,
- ClassWithOverloadedBeforeValidate,
- CommonTypes,
- Country,
- EnumThing,
- Face,
- Highway,
- Location,
- ModifyPerson,
- Nose,
- OptLockNotVersioned,
- OptLockVersioned,
- Person,
- PersonEvent,
- Pet,
- PetType,
- Plant,
- PlantCategory,
- Publication,
- Task,
- TestEntity
+ private List<Class> domainClasses = [
Review Comment:
Would it not be better to store this or at least return a `Class[]` from
`getDomainClasses()` as that is what is consumed downstream to not have to do a
cast?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]