You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2022/05/31 14:21:42 UTC

[GitHub] [sling-org-apache-sling-jcr-resource] joerghoh commented on a diff in pull request #25: SLING-11361 : Sonor findings (excluding complexity and nullable/notnull annotations)

joerghoh commented on code in PR #25:
URL: https://github.com/apache/sling-org-apache-sling-jcr-resource/pull/25#discussion_r885704591


##########
src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/BasicQueryLanguageProvider.java:
##########
@@ -98,85 +99,91 @@ public Iterator<ValueMap> queryResources(final ResolveContext<JcrProviderState>
 
         try {
             final QueryResult result = JcrResourceUtil.query(ctx.getProviderState().getSession(), query, queryLanguage);
-            final String[] colNames = result.getColumnNames();
-            final RowIterator rows = result.getRows();
+            return new ValueMapIterator(result.getColumnNames(), result.getRows());
+        } catch (final javax.jcr.query.InvalidQueryException iqe) {
+            throw new QuerySyntaxException(iqe.getMessage(), query, language, iqe);
+        } catch (final RepositoryException re) {
+            throw new SlingException(re.getMessage(), re);
+        }
+    }
 
-            return new Iterator<ValueMap>() {

Review Comment:
   And here the diff gets really confusing ...



-- 
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: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org