@@ -1715,27 +1715,21 @@ public void maybeRefreshIndexSearchers() {
1715
1715
* to the SearcherManager. This is done with returnIndexSearcher().
1716
1716
* The return of the IndexSearcher should happen only after the search result data are read fully.
1717
1717
*
1718
- * @param proj project
1718
+ * @param projectName project
1719
1719
* @return SearcherManager for given project
1720
1720
* @throws IOException I/O exception
1721
1721
*/
1722
- public SuperIndexSearcher getIndexSearcher (String proj ) throws IOException {
1723
- SearcherManager mgr = searcherManagerMap .get (proj );
1724
- SuperIndexSearcher searcher = null ;
1722
+ public SuperIndexSearcher getIndexSearcher (String projectName ) throws IOException {
1723
+ SearcherManager mgr = searcherManagerMap .get (projectName );
1724
+ SuperIndexSearcher searcher ;
1725
1725
1726
1726
if (mgr == null ) {
1727
1727
File indexDir = new File (getDataRootPath (), IndexDatabase .INDEX_DIR );
1728
-
1729
- try {
1730
- Directory dir = FSDirectory .open (new File (indexDir , proj ).toPath ());
1731
- mgr = new SearcherManager (dir , new ThreadpoolSearcherFactory ());
1732
- searcherManagerMap .put (proj , mgr );
1733
- searcher = (SuperIndexSearcher ) mgr .acquire ();
1734
- searcher .setSearcherManager (mgr );
1735
- } catch (IOException ex ) {
1736
- LOGGER .log (Level .SEVERE ,
1737
- "cannot construct IndexSearcher for project " + proj , ex );
1738
- }
1728
+ Directory dir = FSDirectory .open (new File (indexDir , projectName ).toPath ());
1729
+ mgr = new SearcherManager (dir , new ThreadpoolSearcherFactory ());
1730
+ searcherManagerMap .put (projectName , mgr );
1731
+ searcher = (SuperIndexSearcher ) mgr .acquire ();
1732
+ searcher .setSearcherManager (mgr );
1739
1733
} else {
1740
1734
searcher = (SuperIndexSearcher ) mgr .acquire ();
1741
1735
searcher .setSearcherManager (mgr );
0 commit comments