archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maria Odea Ching <och...@exist.com>
Subject Re: svn commit: r566059 - /maven/archiva/trunk/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java
Date Thu, 16 Aug 2007 08:09:19 GMT
Ok, sorry I've missed that :)

Thanks,
Deng


Brett Porter wrote:
> I think this also needs a null check, in case new MultiSearcher throws 
> the IOException :)
>
> On 15/08/2007, at 6:22 PM, oching@apache.org wrote:
>
>> Author: oching
>> Date: Wed Aug 15 01:22:08 2007
>> New Revision: 566059
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=566059
>> Log:
>> Moved searcher.close() in DefaultCrossRepositorySearch.searchAll(...) 
>> inside finally block.
>>
>> Modified:
>> maven/archiva/trunk/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java

>>
>>
>> Modified: 
>> maven/archiva/trunk/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java

>>
>> URL: 
>> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java?view=diff&rev=566059&r1=566058&r2=566059

>>
>> ============================================================================== 
>>
>> --- 
>> maven/archiva/trunk/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java

>> (original)
>> +++ 
>> maven/archiva/trunk/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java

>> Wed Aug 15 01:22:08 2007
>> @@ -190,10 +190,12 @@
>> 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,11 +240,21 @@
>> }
>> }
>>
>> - 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;
>>
>


Mime
View raw message