Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with Apache Groovy 3.0.19 #1767

Closed
puneetbehl opened this issue Nov 9, 2023 · 4 comments
Closed

Incompatibility with Apache Groovy 3.0.19 #1767

puneetbehl opened this issue Nov 9, 2023 · 4 comments

Comments

@puneetbehl
Copy link
Contributor

puneetbehl commented Nov 9, 2023

Compiling the project against Apache Groovy 3.0.19 gives following error:

> Task :grails-datastore-gorm-validation:compileGroovy
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/behl/GitHub/grails-data-mapping/grails-datastore-gorm-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/MinConstraint.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
startup failed:
/Users/behl/GitHub/grails-data-mapping/grails-datastore-gorm-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/registry/DefaultConstraintRegistry.groovy: 38: [Static type checking] - Incompatible generic argument types. Cannot assign java.util.Map <String, java.util.List> to: java.util.Map <String, List>
 @ line 38, column 70.
   ntFactory>> factoriesByName = new Concur
                                 ^

/Users/behl/GitHub/grails-data-mapping/grails-datastore-gorm-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/registry/DefaultConstraintRegistry.groovy: 41: [Static type checking] - Incompatible generic argument types. Cannot assign java.util.Map <Class, java.util.List> to: java.util.Map <Class, List>
 @ line 41, column 91.
   ntFactory>> factoriesByType = new Concur
                                 ^

2 errors


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':grails-datastore-gorm-validation:compileGroovy'.
> Compilation failed; see the compiler error output for details.

The Groovy code which is throwing this error is:

protected Map<String, List<ConstraintFactory>> factoriesByName = new ConcurrentHashMap<String, List<ConstraintFactory>>().withDefault { String name ->
    return []
}
protected Map<Class<? extends Constraint>, List<ConstraintFactory>> factoriesByType = new ConcurrentHashMap<Class<? extends Constraint>, List<ConstraintFactory>>().withDefault { Class<? extends Constraint> type ->
    return []
}
@puneetbehl
Copy link
Contributor Author

@paulk-asert Could you please help with this?

@matrei
Copy link
Contributor

matrei commented Nov 9, 2023

@puneetbehl Hmm, those lines where changed in #1754. Do you have the 8.0.x branch checked out?

@puneetbehl
Copy link
Contributor Author

I will crosscheck next week and revert back.

@matrei
Copy link
Contributor

matrei commented Nov 24, 2023

Fixed by #1754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants