mirror of https://github.com/apache/archiva.git
Moved searcher.close() in DefaultCrossRepositorySearch.searchAll(...) inside finally block.
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@566059 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8109fee8e6
commit
fb626a92e5
|
@ -190,10 +190,12 @@ public class DefaultCrossRepositorySearch
|
|||
Searchable searchables[] = new Searchable[searchableList.size()];
|
||||
searchableList.toArray( searchables );
|
||||
|
||||
MultiSearcher searcher = null;
|
||||
|
||||
try
|
||||
{
|
||||
// Create a multi-searcher for looking up the information.
|
||||
MultiSearcher searcher = new MultiSearcher( searchables );
|
||||
searcher = new MultiSearcher( searchables );
|
||||
|
||||
// Perform the search.
|
||||
Hits hits = searcher.search( specificQuery );
|
||||
|
@ -238,12 +240,22 @@ public class DefaultCrossRepositorySearch
|
|||
}
|
||||
}
|
||||
|
||||
searcher.close();
|
||||
}
|
||||
catch ( IOException e )
|
||||
{
|
||||
getLogger().error( "Unable to setup multi-search: " + e.getMessage(), e );
|
||||
}
|
||||
finally
|
||||
{
|
||||
try
|
||||
{
|
||||
searcher.close();
|
||||
}
|
||||
catch ( IOException ie )
|
||||
{
|
||||
getLogger().error( "Unable to close index searcher: " + ie.getMessage(), ie );
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue