You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Biju Kunjummen (JIRA)" <ji...@apache.org> on 2018/06/05 20:57:00 UTC
[jira] [Commented] (GEODE-5290) Use of
ResultsCollectionPdxDeserializerWrapper iterator results in NPE
[ https://issues.apache.org/jira/browse/GEODE-5290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16502491#comment-16502491 ]
Biju Kunjummen commented on GEODE-5290:
---------------------------------------
After repeated attempts to simulate this behavior, this specific scenario could NOT be replicated for `SelectResults.asList()` method. However it could be simulated by calling a `get` on the resulting list.
list.get(0)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at org.apache.geode.cache.query.dunit.PdxQueryDUnitTest$32.run2(PdxQueryDUnitTest.java:922)
A new test will validate this.
> Use of ResultsCollectionPdxDeserializerWrapper iterator results in NPE
> ----------------------------------------------------------------------
>
> Key: GEODE-5290
> URL: https://issues.apache.org/jira/browse/GEODE-5290
> Project: Geode
> Issue Type: Bug
> Components: querying
> Reporter: Biju Kunjummen
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.7.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Use of default constructor of ResultsCollectionPdxDeserializerWrapper and getting an iterator from it results in NPE:
> {{SelectResults<Struct> sr1 = new ResultsCollectionPdxDeserializerWrapper();}}
> {{sr1.asList();}}
>
> Results in :
>
> {{java.lang.NullPointerException}}
> {{at org.apache.geode.cache.query.internal.ResultsCollectionPdxDeserializerWrapper.iterator(ResultsCollectionPdxDeserializerWrapper.java:52)}}
> {{at org.apache.geode.cache.query.internal.ResultsCollectionPdxDeserializerWrapper.toArray(ResultsCollectionPdxDeserializerWrapper.java:174)}}
> {{at java.util.ArrayList.<init>(ArrayList.java:178)}}
> {{at org.apache.geode.cache.query.internal.ResultsCollectionPdxDeserializerWrapper.asList(ResultsCollectionPdxDeserializerWrapper.java:208)}}
>
> Additionally, user reported exception with a code along these lines:
>
> {{When a query with `SUM` aggregate is called:}}
> {{select sum(totalHoldingsValue) from /ExternalAccounts where uniqueAcctId IN SET (‘4’,‘5’,‘6’,‘|')}}
> Per the ticket a code of this type:
> {{String query = “<trace>select sum(totalHoldingsValue) from /ExternalAccounts where uniqueAcctId IN SET (” + externalAccountNumbers + “)”;}}
> {{SelectResults<Struct> preResults = executeTotalsQuery(queryService, query, externalAccountsRegion);}}
> {{logger.info(“query = ” + query.toString());}}
> {{logger.info(“query return object= ” + preResults.getClass().getName());}}
> {{logger.info(“query return size= ” + preResults.size());}}{{Iterator it = preResults.iterator();}}
> {{if (it.hasNext())}}{{{ logger.info(“query return = ” + it.next()); }}}
> {{List<?> results = (List) preResults.asList();}}}}
> threw an exception :
> {{Index: 0, Size: 0}}
> {{java.util.ArrayList.rangeCheck(ArrayList.java:653)}}
> {{java.util.ArrayList.get(ArrayList.java:429)}}
> {{io.pivotal.bofa.builder.PortfolioTotalsBuilder.queryExternalPortfolioTotals(PortfolioTotalsBuilder.java:81)}}
> {{io.pivotal.bofa.builder.PortfolioTotalsBuilder.build(PortfolioTotalsBuilder.java:43)}}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)