[
https://issues.jboss.org/browse/ISPN-2788?page=com.atlassian.jira.plugin....
]
Anna Manukyan commented on ISPN-2788:
-------------------------------------
My code is the following:
{code}
File rootDir = createRootDir(); //Creating root directory of the index
EmbeddedCacheManager cacheManager = null;
createIndex(rootDir, indexName, elementCount, true); //Manually writes some data to the
index with number of elementCount to index with name indexName - as is done in
org.infinispan.lucene.cacheloader.IndexCacheLoaderTest
ConfigurationBuilder builder = new ConfigurationBuilder();
builder
.loaders()
.addLoader()
.cacheLoader( new LuceneCacheLoader() )
.addProperty(LuceneCacheLoaderConfig.LOCATION_OPTION, rootDir.getAbsolutePath())
.addProperty(LuceneCacheLoaderConfig.AUTO_CHUNK_SIZE_OPTION, "1024");
EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createCacheManager(builder);
LuceneCacheLoader cacheLoader = (LuceneCacheLoader)
TestingUtil.extractComponent(cacheManager.getCache(),
CacheLoaderManager.class).getCacheLoader();
Set keyList = cacheLoader.loadAllKeys(null); // <<<----- This is the line which
throws the NullPointerException.
{code}
According to JavaDoc, if null is passed as a parameter to loadAllKeys() method, then it
should load all keys without exclusions, but instead it throws NullPointerException.
NullPointerException appears in case passing null as an exclusion
list to LuceneCacheLoader.loadAllKeys()
---------------------------------------------------------------------------------------------------------
Key: ISPN-2788
URL:
https://issues.jboss.org/browse/ISPN-2788
Project: Infinispan
Issue Type: Bug
Components: Lucene Directory
Affects Versions: 5.2.0.Final
Reporter: Anna Manukyan
Assignee: Sanne Grinovero
Fix For: 5.3.0.Alpha1
NullPointerException is thrown in case of passing null as a keyExclusionList to
LuceneCacheLoader.loadAllKeys() method.
The log is:
{code}
java.lang.NullPointerException
at
org.infinispan.lucene.cachestore.DirectoryLoaderAdaptor.loadSomeKeys(DirectoryLoaderAdaptor.java:108)
at
org.infinispan.lucene.cachestore.DirectoryLoaderAdaptor.loadAllKeys(DirectoryLoaderAdaptor.java:174)
at
org.infinispan.lucene.cachestore.LuceneCacheLoader.loadAllKeys(LuceneCacheLoader.java:126)
at
org.infinispan.lucene.cacheloader.LuceneCacheLoaderTest.testLoadAllKeysWithNullExclusion(LuceneCacheLoaderTest.java:263)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:37)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:368)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira