You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Brett Porter <br...@apache.org> on 2006/01/24 01:18:59 UTC

Re: svn commit: r371476 - in /maven/repository-manager/trunk/maven-repository-indexer

I think this is a possible NPE...

epunzalan@apache.org wrote:
> +    /**
> +     * @see org.apache.maven.repository.indexing.RepositoryIndex#deleteDocument(String, String)
> +     */
> +    public void deleteDocument( String field, String value )
> +        throws RepositoryIndexException, IOException
> +    {
> +        IndexReader indexReader = null;
> +        try
> +        {
> +            indexReader = IndexReader.open( indexPath );
> +            indexReader.delete( new Term( field, value ) );
> +        }
> +        catch ( IOException ie )
> +        {
> +            throw new RepositoryIndexException( indexPath + "is not a valid directory." );
> +        }
> +        finally
> +        {
> +            indexReader.close();
> +        }
>      }
>  }

Can you please separate reformatting commits from functional changes?

> -        else if( query instanceof RangeQuery )
> +        else if ( query instanceof RangeQuery )

Why is a new ID required? Can't the pieces of group/artifact/type be
used as is?

> +        doc.add( Field.Keyword( FLD_ID, ARTIFACT_TYPE + artifact.getId() ) );

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r371476 - in /maven/repository-manager/trunk/maven-repository-indexer

Posted by Edwin Punzalan <ep...@exist.com>.
About the FLD_ID, the delete method for a document cannot have more than 
one Term object for groupId, artifactId, and version so an ID is used.

i apologize about the others, I'll fix them right away...



Brett Porter wrote:

>I think this is a possible NPE...
>
>epunzalan@apache.org wrote:
>  
>
>>+    /**
>>+     * @see org.apache.maven.repository.indexing.RepositoryIndex#deleteDocument(String, String)
>>+     */
>>+    public void deleteDocument( String field, String value )
>>+        throws RepositoryIndexException, IOException
>>+    {
>>+        IndexReader indexReader = null;
>>+        try
>>+        {
>>+            indexReader = IndexReader.open( indexPath );
>>+            indexReader.delete( new Term( field, value ) );
>>+        }
>>+        catch ( IOException ie )
>>+        {
>>+            throw new RepositoryIndexException( indexPath + "is not a valid directory." );
>>+        }
>>+        finally
>>+        {
>>+            indexReader.close();
>>+        }
>>     }
>> }
>>    
>>
>
>Can you please separate reformatting commits from functional changes?
>
>  
>
>>-        else if( query instanceof RangeQuery )
>>+        else if ( query instanceof RangeQuery )
>>    
>>
>
>Why is a new ID required? Can't the pieces of group/artifact/type be
>used as is?
>
>  
>
>>+        doc.add( Field.Keyword( FLD_ID, ARTIFACT_TYPE + artifact.getId() ) );
>>    
>>
>
>- Brett
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org