codeconsole commented on code in PR #16693:
URL: https://github.com/apache/grails-core/pull/16693#discussion_r4332480776
##########
grails-datamapping-rx/src/main/groovy/org/grails/gorm/rx/services/implementers/SingleResultAdapter.groovy:
##########
@@ -87,8 +87,13 @@ class SingleResultAdapter implements ServiceImplementer,
Ordered, AdaptedImpleme
else {
String prefix = adapted.resolvePrefix(methodNode)
if (adapted instanceof
SingleResultProjectionServiceImplementer) {
+ // The projection implementer checks the projected type
alone, so the Single return type is
+ // checked here: an Observable of the projected type
belongs to ObservableResultAdapter
+ if (!RxAstUtils.isSingle(methodReturnType) ||
methodReturnType.isArray()) {
Review Comment:
Nit: `|| methodReturnType.isArray()` can never be true here. `isSingle`
walks the superclass chain, and an array `ClassNode` extends `Object`, so an
array return type has already failed `isSingle`. This is the one partial line
Codecov reports for the PR. `if (!RxAstUtils.isSingle(methodReturnType))` is
enough.
The `&& !methodReturnType.isArray()` checks at the top of `doesImplement`
are already dead in the same way, so keeping it for consistency is fine too.
--
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]