[ https://issues.apache.org/jira/browse/IGNITE-1355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14938203#comment-14938203 ]
Artem Shutak commented on IGNITE-1355: -------------------------------------- Ignite.affinity(...) can be called for cache nonexistent cache. As a result a call to any method of the affinity will produce NPE. Fix proposal: - return special value and empty arrays/collections in this case - update javadoc for these goals > Potential NPE in CacheAffinityProxy > ----------------------------------- > > Key: IGNITE-1355 > URL: https://issues.apache.org/jira/browse/IGNITE-1355 > Project: Ignite > Issue Type: Bug > Components: cache > Affects Versions: ignite-1.4 > Reporter: Semen Boikov > Assignee: Artem Shutak > Priority: Critical > Fix For: ignite-1.5 > > > NPE was observed on TC: > {noformat} > java.lang.NullPointerException > at > org.apache.ignite.internal.processors.affinity.GridAffinityProcessor$AffinityInfo.access$1800(GridAffinityProcessor.java:537) > at > org.apache.ignite.internal.processors.affinity.GridAffinityProcessor$CacheAffinityProxy.mapPartitionToPrimaryAndBackups(GridAffinityProcessor.java:879) > at > org.apache.ignite.testframework.junits.common.GridCommonAbstractTest.awaitPartitionMapExchange(GridCommonAbstractTest.java:423) > at > org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCacheCrossCacheTxFailoverTest.crossCacheTxFailover(IgniteCacheCrossCacheTxFailoverTest.java:355) > {noformat} > As I see method CacheAffinityProxy.cache() can return null, but there are no > checks for null. -- This message was sent by Atlassian JIRA (v6.3.4#6332)