You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on test case for #767 I wanted to peruse modified version (so that it returns set of strings instead of writing them to the log) of IndexDatabase#listFiles() and call it like this:
Assert.assertEquals(6, idb.getFiles().size());
however got exception instead:
Testcase: testCleanupAfterIndexRemoval(org.opensolaris.opengrok.index.IndexDatabaseTest): Caused an ERROR
String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1967)
at org.opensolaris.opengrok.web.Util.uid2url(Util.java:647)
at org.opensolaris.opengrok.index.IndexDatabase.getFiles(IndexDatabase.java:1028)
at org.opensolaris.opengrok.index.IndexDatabaseTest.testCleanupAfterIndexRemoval(IndexDatabaseTest.java:164)
This is curious feature anyway that is being called from Indexer#prepareIndexer:
789 if (listFiles) {
790 IndexDatabase.listAllFiles(subFiles);
791 }
however the listFiles boolean does not have a matching command line option and is set to false by default so likely this code path has not been called for a long time. Hence filing this issue so that it is not forgotten. Either it should be fixed or ripped out.
The text was updated successfully, but these errors were encountered:
vladak
changed the title
IndexDatabase.getFiles functionality needs to be investigated
IndexDatabase.getFiles() functionality needs to be investigated
Jul 21, 2017
When working on test case for #767 I wanted to peruse modified version (so that it returns set of strings instead of writing them to the log) of
IndexDatabase#listFiles()
and call it like this:however got exception instead:
This is curious feature anyway that is being called from
Indexer#prepareIndexer
:however the
listFiles
boolean does not have a matching command line option and is set tofalse
by default so likely this code path has not been called for a long time. Hence filing this issue so that it is not forgotten. Either it should be fixed or ripped out.The text was updated successfully, but these errors were encountered: