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:
Maria Odea B. Ching 2007-08-15 08:22:08 +00:00
parent 8109fee8e6
commit fb626a92e5
1 changed files with 14 additions and 2 deletions

View File

@ -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;
}