jdaugherty commented on code in PR #16693:
URL: https://github.com/apache/grails-core/pull/16693#discussion_r4337216920


##########
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:
   Agreed, and dropped in 0cc718c9dd: `isSubclassOf` compares the node name 
(`rx.Single[]` for an array) and then walks a superclass chain that ends at 
`Object`, so an array never reaches the `isArray()` test. The guard is now `if 
(!RxAstUtils.isSingle(methodReturnType))`, which also matches the 
`isObservable` guard in `ObservableResultAdapter`. The pre-existing `&& 
!isArray()` checks above are left as they were.



-- 
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]

Reply via email to