maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r412295 [1/2] - in /maven/repository-manager/trunk: maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/ maven-repository-artifact-applet/ maven-repository-artifact-applet/src/main/java/org/apache/maven/reposi...
Date Wed, 07 Jun 2006 05:47:47 GMT
Author: brett
Date: Tue Jun  6 22:47:45 2006
New Revision: 412295

URL: http://svn.apache.org/viewvc?rev=412295&view=rev
Log:
general clean up, addition of copyrights

Modified:
    maven/repository-manager/trunk/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexSearcherCli.java
    maven/repository-manager/trunk/maven-repository-artifact-applet/pom.xml
    maven/repository-manager/trunk/maven-repository-artifact-applet/src/main/java/org/apache/maven/repository/applet/ChecksumApplet.java
    maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/DefaultRepositoryConverter.java
    maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/transaction/TransactionEvent.java
    maven/repository-manager/trunk/maven-repository-converter/src/main/resources/org/apache/maven/repository/converter/DefaultRepositoryConverter.properties
    maven/repository-manager/trunk/maven-repository-converter/src/test/java/org/apache/maven/repository/converter/RepositoryConverterTest.java
    maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom
    maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom
    maven/repository-manager/trunk/maven-repository-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom
    maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractArtifactDiscoverer.java
    maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractDiscoverer.java
    maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/DefaultMetadataDiscoverer.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexSearcher.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexingFactory.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchHit.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayer.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexingFactory.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/Query.java
    maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/SinglePhraseQuery.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndexingTest.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/EclipseRepositoryIndexTest.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/MetadataRepositoryIndexingTest.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/PomRepositoryIndexingTest.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayerTest.java
    maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/query/QueryTest.java
    maven/repository-manager/trunk/maven-repository-manager-site/pom.xml
    maven/repository-manager/trunk/maven-repository-manager-site/src/site/site.xml
    maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java
    maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java
    maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/MavenProxyPropertyLoader.java
    maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ProxyConfiguration.java
    maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/configuration/ValidationException.java
    maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/repository/ProxyRepository.java
    maven/repository-manager/trunk/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/DefaultProxyManagerTest.java
    maven/repository-manager/trunk/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/LegacyProxyManagerTest.java
    maven/repository-manager/trunk/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/MavenProxyPropertyLoaderTest.java
    maven/repository-manager/trunk/maven-repository-proxy/src/test/java/org/apache/maven/repository/proxy/configuration/ProxyConfigurationTest.java
    maven/repository-manager/trunk/maven-repository-reports-standard/src/main/java/org/apache/maven/repository/reporting/Cache.java
    maven/repository-manager/trunk/maven-repository-utils/src/main/java/org/apache/maven/repository/ArtifactUtils.java
    maven/repository-manager/trunk/maven-repository-utils/src/main/java/org/apache/maven/repository/digest/DefaultDigester.java
    maven/repository-manager/trunk/maven-repository-utils/src/test/java/org/apache/maven/repository/ArtifactUtilsLegacyTest.java
    maven/repository-manager/trunk/maven-repository-webapp/pom.xml
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/BaseAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/GeneralSearchAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/PackageSearchAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/RepositoryBrowseAction.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/execution/DiscovererExecution.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/Configuration.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererJob.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/job/DiscovererScheduler.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/decorators.xml
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/form.jspf
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/jsp/index.jsp
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/WEB-INF/web.xml
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/css/maven-base.css
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/css/maven-theme.css
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/css/print.css
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/css/site.css
    maven/repository-manager/trunk/maven-repository-webapp/src/main/webapp/index.jsp

Modified: maven/repository-manager/trunk/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexSearcherCli.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexSearcherCli.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexSearcherCli.java (original)
+++ maven/repository-manager/trunk/maven-repository-application/src/main/java/org/apache/maven/repository/manager/cli/IndexSearcherCli.java Tue Jun  6 22:47:45 2006
@@ -20,10 +20,10 @@
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.repository.indexing.ArtifactRepositoryIndex;
+import org.apache.maven.repository.indexing.DefaultRepositoryIndexSearcher;
 import org.apache.maven.repository.indexing.RepositoryIndexException;
 import org.apache.maven.repository.indexing.RepositoryIndexSearchException;
 import org.apache.maven.repository.indexing.RepositoryIndexingFactory;
-import org.apache.maven.repository.indexing.DefaultRepositoryIndexSearcher;
 import org.apache.maven.repository.indexing.query.SinglePhraseQuery;
 import org.codehaus.classworlds.ClassWorld;
 import org.codehaus.plexus.PlexusContainerException;
@@ -40,6 +40,10 @@
  */
 public class IndexSearcherCli
 {
+    private IndexSearcherCli()
+    {
+    }
+
     public static void main( String[] args )
         throws PlexusContainerException, ComponentLookupException, RepositoryIndexException, MalformedURLException,
         RepositoryIndexSearchException
@@ -62,7 +66,7 @@
 
         ArtifactRepositoryIndex index =
             indexFactory.createArtifactRepositoryIndex( new File( args[0], ".index" ).getAbsolutePath(), repository );
-              
+
         DefaultRepositoryIndexSearcher searcher = indexFactory.createDefaultRepositoryIndexSearcher( index );
 
         try

Modified: maven/repository-manager/trunk/maven-repository-artifact-applet/pom.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-artifact-applet/pom.xml?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-artifact-applet/pom.xml (original)
+++ maven/repository-manager/trunk/maven-repository-artifact-applet/pom.xml Tue Jun  6 22:47:45 2006
@@ -1,3 +1,19 @@
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>

Modified: maven/repository-manager/trunk/maven-repository-artifact-applet/src/main/java/org/apache/maven/repository/applet/ChecksumApplet.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-artifact-applet/src/main/java/org/apache/maven/repository/applet/ChecksumApplet.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-artifact-applet/src/main/java/org/apache/maven/repository/applet/ChecksumApplet.java (original)
+++ maven/repository-manager/trunk/maven-repository-artifact-applet/src/main/java/org/apache/maven/repository/applet/ChecksumApplet.java Tue Jun  6 22:47:45 2006
@@ -14,7 +14,6 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 
 import javax.swing.*;
@@ -56,53 +55,73 @@
     public String generateMd5( final String file )
         throws IOException, NoSuchAlgorithmException
     {
-        return (String) AccessController.doPrivileged( new PrivilegedAction()
+        Object o = AccessController.doPrivileged( new PrivilegedAction()
         {
             public Object run()
             {
                 try
                 {
-                    MessageDigest digest = MessageDigest.getInstance( "MD5" );
-
-                    long total = new File( file ).length();
-                    InputStream fis = new FileInputStream( file );
-                    try
-                    {
-                        long totalRead = 0;
-                        byte[] buffer = new byte[CHECKSUM_BUFFER_SIZE];
-                        int numRead;
-                        do
-                        {
-                            numRead = fis.read( buffer );
-                            if ( numRead > 0 )
-                            {
-                                digest.update( buffer, 0, numRead );
-                                totalRead += numRead;
-                                progressBar.setValue( (int) ( totalRead * progressBar.getMaximum() / total ) );
-                            }
-                        }
-                        while ( numRead != -1 );
-                    }
-                    finally
-                    {
-                        fis.close();
-                    }
-
-                    return byteArrayToHexStr( digest.digest() );
+                    return checksumFile( file );
                 }
                 catch ( NoSuchAlgorithmException e )
                 {
-                    throw new RuntimeException( e );
+                    return e;
                 }
                 catch ( IOException e )
                 {
-                    throw new RuntimeException( e );
+                    return e;
                 }
             }
         } );
+
+        //noinspection ChainOfInstanceofChecks
+        if ( o instanceof IOException )
+        {
+            throw (IOException) o;
+        }
+        else if ( o instanceof NoSuchAlgorithmException )
+        {
+            throw (NoSuchAlgorithmException) o;
+        }
+        else
+        {
+            return (String) o;
+        }
+    }
+
+    protected String checksumFile( String file )
+        throws NoSuchAlgorithmException, IOException
+    {
+        MessageDigest digest = MessageDigest.getInstance( "MD5" );
+
+        long total = new File( file ).length();
+        InputStream fis = new FileInputStream( file );
+        try
+        {
+            long totalRead = 0;
+            byte[] buffer = new byte[CHECKSUM_BUFFER_SIZE];
+            int numRead;
+            do
+            {
+                numRead = fis.read( buffer );
+                if ( numRead > 0 )
+                {
+                    digest.update( buffer, 0, numRead );
+                    totalRead += numRead;
+                    progressBar.setValue( (int) ( totalRead * progressBar.getMaximum() / total ) );
+                }
+            }
+            while ( numRead != -1 );
+        }
+        finally
+        {
+            fis.close();
+        }
+
+        return byteArrayToHexStr( digest.digest() );
     }
 
-    private static String byteArrayToHexStr( byte[] data )
+    protected static String byteArrayToHexStr( byte[] data )
     {
         String output = "";
 

Modified: maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/DefaultRepositoryConverter.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/DefaultRepositoryConverter.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/DefaultRepositoryConverter.java (original)
+++ maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/DefaultRepositoryConverter.java Tue Jun  6 22:47:45 2006
@@ -32,6 +32,7 @@
 import org.apache.maven.model.Relocation;
 import org.apache.maven.model.converter.ArtifactPomRewriter;
 import org.apache.maven.model.converter.ModelConverter;
+import org.apache.maven.model.converter.PomTranslationException;
 import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
 import org.apache.maven.model.v3_0_0.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.repository.converter.transaction.FileTransaction;
@@ -43,6 +44,7 @@
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.StringReader;
@@ -213,6 +215,10 @@
             fileReader = new FileReader( file );
             metadata = reader.read( fileReader );
         }
+        catch ( FileNotFoundException e )
+        {
+            throw new RepositoryConversionException( "Error reading target metadata", e );
+        }
         catch ( IOException e )
         {
             throw new RepositoryConversionException( "Error reading target metadata", e );
@@ -443,9 +449,15 @@
                     reporter.addFailure( artifact, getI18NString( "failure.invalid.source.pom", e.getMessage() ) );
                     result = false;
                 }
-                catch ( Exception e )
+                catch ( IOException e )
                 {
                     throw new RepositoryConversionException( "Unable to write converted POM", e );
+                }
+                catch ( PomTranslationException e )
+                {
+                    // TODO! check handling, fix error message
+                    reporter.addFailure( artifact, getI18NString( "failure.invalid.source.pom", e.getMessage() ) );
+                    result = false;
                 }
                 finally
                 {

Modified: maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/transaction/TransactionEvent.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/transaction/TransactionEvent.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/transaction/TransactionEvent.java (original)
+++ maven/repository-manager/trunk/maven-repository-converter/src/main/java/org/apache/maven/repository/converter/transaction/TransactionEvent.java Tue Jun  6 22:47:45 2006
@@ -1,7 +1,5 @@
 package org.apache.maven.repository.converter.transaction;
 
-import java.io.IOException;
-
 /*
  * Copyright 2005-2006 The Apache Software Foundation.
  *
@@ -17,6 +15,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+import java.io.IOException;
 
 /**
  * Interface for individual events in a transaction.

Modified: maven/repository-manager/trunk/maven-repository-converter/src/main/resources/org/apache/maven/repository/converter/DefaultRepositoryConverter.properties
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-converter/src/main/resources/org/apache/maven/repository/converter/DefaultRepositoryConverter.properties?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-converter/src/main/resources/org/apache/maven/repository/converter/DefaultRepositoryConverter.properties (original)
+++ maven/repository-manager/trunk/maven-repository-converter/src/main/resources/org/apache/maven/repository/converter/DefaultRepositoryConverter.properties Tue Jun  6 22:47:45 2006
@@ -23,6 +23,7 @@
 
 exception.repositories.match=Source and target repositories are identical.
 
+# TODO! update definitions
 failure.incorrect.groupMetadata.groupId=The group ID in the source group metadata is incorrect.
 
 failure.incorrect.artifactMetadata.artifactId=The artifact ID in the source artifact metadata is incorrect.

Modified: maven/repository-manager/trunk/maven-repository-converter/src/test/java/org/apache/maven/repository/converter/RepositoryConverterTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-converter/src/test/java/org/apache/maven/repository/converter/RepositoryConverterTest.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-converter/src/test/java/org/apache/maven/repository/converter/RepositoryConverterTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-converter/src/test/java/org/apache/maven/repository/converter/RepositoryConverterTest.java Tue Jun  6 22:47:45 2006
@@ -581,10 +581,10 @@
         File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) );
         File targetPomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( pomArtifact ) );
 
-        SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+        SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd", Locale.getDefault() );
         long origTime = dateFormat.parse( "2006-03-03" ).getTime();
-	targetFile.setLastModified( origTime );
-	targetPomFile.setLastModified( origTime );
+        targetFile.setLastModified( origTime );
+        targetPomFile.setLastModified( origTime );
 
         sourceFile.setLastModified( dateFormat.parse( "2006-01-01" ).getTime() );
         sourcePomFile.setLastModified( dateFormat.parse( "2006-02-02" ).getTime() );
@@ -954,7 +954,7 @@
             }
             else if ( file.isDirectory() )
             {
-                if ( !file.getName().equals( ".svn" ) )
+                if ( !".svn".equals( file.getName() ) )
                 {
                     if ( !destination.exists() && !destination.mkdirs() )
                     {

Modified: maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom (original)
+++ maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom Tue Jun  6 22:47:45 2006
@@ -12,7 +12,6 @@
   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
-  ~
   -->
 
 <project>

Modified: maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom (original)
+++ maven/repository-manager/trunk/maven-repository-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom Tue Jun  6 22:47:45 2006
@@ -12,7 +12,6 @@
   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
-  ~
   -->
 
 <project>

Modified: maven/repository-manager/trunk/maven-repository-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom (original)
+++ maven/repository-manager/trunk/maven-repository-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom Tue Jun  6 22:47:45 2006
@@ -12,7 +12,6 @@
   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
-  ~
   -->
 
 <project>

Modified: maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractArtifactDiscoverer.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractArtifactDiscoverer.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractArtifactDiscoverer.java (original)
+++ maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractArtifactDiscoverer.java Tue Jun  6 22:47:45 2006
@@ -20,9 +20,12 @@
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.FileReader;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -42,12 +45,12 @@
         "**/*.MD5", "**/*.sha1", "**/*.SHA1", "**/*snapshot-version", "*/website/**", "*/licenses/**", "*/licences/**",
         "**/.htaccess", "**/*.html", "**/*.asc", "**/*.txt", "**/*.xml", "**/README*", "**/CHANGELOG*", "**/KEYS*"};
 
-    protected static final String POM = ".pom";
+    private static final String POM = ".pom";
 
     /**
      * Scan the repository for artifact paths.
      */
-    protected String[] scanForArtifactPaths( File repositoryBase, String blacklistedPatterns )
+    private String[] scanForArtifactPaths( File repositoryBase, String blacklistedPatterns )
     {
         return scanForArtifactPaths( repositoryBase, blacklistedPatterns, null, STANDARD_DISCOVERY_EXCLUDES );
     }
@@ -114,7 +117,7 @@
                 try
                 {
                     Model model = mavenReader.read( new FileReader( filename ) );
-                    if ( ( pomArtifact != null ) && ( "pom".equals( model.getPackaging() ) ) )
+                    if ( pomArtifact != null && "pom".equals( model.getPackaging() ) )
                     {
                         if ( includeSnapshots || !pomArtifact.isSnapshot() )
                         {
@@ -122,10 +125,19 @@
                         }
                     }
                 }
-                catch ( Exception e )
+                catch ( FileNotFoundException e )
                 {
-                    getLogger().info( "error reading file: " + filename );
-                    e.printStackTrace();
+                    // this should never happen
+                    getLogger().error( "Error finding file during POM discovery: " + filename, e );
+                }
+                catch ( IOException e )
+                {
+                    getLogger().error( "Error reading file during POM discovery: " + filename + ": " + e );
+                }
+                catch ( XmlPullParserException e )
+                {
+                    getLogger().error(
+                        "Parse error reading file during POM discovery: " + filename + ": " + e.getMessage() );
                 }
             }
         }

Modified: maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractDiscoverer.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractDiscoverer.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractDiscoverer.java (original)
+++ maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/AbstractDiscoverer.java Tue Jun  6 22:47:45 2006
@@ -1,5 +1,21 @@
 package org.apache.maven.repository.discovery;
 
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.DirectoryScanner;
@@ -16,7 +32,7 @@
  *
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  */
-public class AbstractDiscoverer
+public abstract class AbstractDiscoverer
     extends AbstractLogEnabled
 {
     private List kickedOutPaths = new ArrayList();

Modified: maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/DefaultMetadataDiscoverer.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/DefaultMetadataDiscoverer.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/DefaultMetadataDiscoverer.java (original)
+++ maven/repository-manager/trunk/maven-repository-discovery/src/main/java/org/apache/maven/repository/discovery/DefaultMetadataDiscoverer.java Tue Jun  6 22:47:45 2006
@@ -129,7 +129,7 @@
             //}
 
             Artifact artifact = null;
-            if ( metaVersion != null && !metaVersion.equals( "" ) )
+            if ( metaVersion != null && !"".equals( metaVersion ) )
             {
                 artifact = artifactFactory.createBuildArtifact( metaGroupId, metaArtifactId, metaVersion, "jar" );
             }

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java Tue Jun  6 22:47:45 2006
@@ -54,10 +54,8 @@
      *
      * @param indexPath
      * @param repository
-     * @throws RepositoryIndexException
      */
     protected AbstractRepositoryIndex( String indexPath, ArtifactRepository repository )
-        throws RepositoryIndexException
     {
         this.repository = repository;
         this.indexPath = indexPath;
@@ -237,11 +235,10 @@
      * Check if the index already exists.
      *
      * @return true if the index already exists
-     * @throws IOException
      * @throws RepositoryIndexException
      */
     protected boolean indexExists()
-        throws IOException, RepositoryIndexException
+        throws RepositoryIndexException
     {
         File indexDir = new File( indexPath );
 
@@ -332,7 +329,7 @@
         return isAdded;
     }
 
-    private class ArtifactRepositoryIndexAnalyzer
+    private static class ArtifactRepositoryIndexAnalyzer
         extends Analyzer
     {
         private Analyzer defaultAnalyzer;
@@ -342,7 +339,7 @@
          *
          * @param defaultAnalyzer the analyzer to use as default for the general fields of the artifact indeces
          */
-        public ArtifactRepositoryIndexAnalyzer( Analyzer defaultAnalyzer )
+        ArtifactRepositoryIndexAnalyzer( Analyzer defaultAnalyzer )
         {
             this.defaultAnalyzer = defaultAnalyzer;
         }
@@ -369,33 +366,33 @@
 
             return tokenStream;
         }
+    }
 
+    /**
+     * Class used to tokenize an artifact's version.
+     */
+    private static class VersionTokenizer
+        extends CharTokenizer
+    {
         /**
-         * Class used to tokenize an artifact's version.
+         * Constructor with the required reader to the index stream
+         *
+         * @param reader the Reader object of the index stream
          */
-        private class VersionTokenizer
-            extends CharTokenizer
+        VersionTokenizer( Reader reader )
         {
-            /**
-             * Constructor with the required reader to the index stream
-             *
-             * @param reader the Reader object of the index stream
-             */
-            VersionTokenizer( Reader reader )
-            {
-                super( reader );
-            }
+            super( reader );
+        }
 
-            /**
-             * method that lucene calls to check tokenization of a stream character
-             *
-             * @param character char currently being processed
-             * @return true if the char is a token, false if the char is a stop char
-             */
-            protected boolean isTokenChar( char character )
-            {
-                return character != '.' && character != '-';
-            }
+        /**
+         * method that lucene calls to check tokenization of a stream character
+         *
+         * @param character char currently being processed
+         * @return true if the char is a token, false if the char is a stop char
+         */
+        protected boolean isTokenChar( char character )
+        {
+            return character != '.' && character != '-';
         }
     }
 }

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java Tue Jun  6 22:47:45 2006
@@ -47,10 +47,8 @@
      * @param indexPath  the path where the lucene index will be created/updated.
      * @param repository the repository where the indexed artifacts are located
      * @param digester   the digester object to generate the checksum strings
-     * @throws RepositoryIndexException
      */
     public ArtifactRepositoryIndex( String indexPath, ArtifactRepository repository, Digester digester )
-        throws RepositoryIndexException
     {
         super( indexPath, repository );
         this.digester = digester;
@@ -179,12 +177,9 @@
      *
      * @param name     the complete path name of the class
      * @param packages the packages buffer
-     * @return true if the package is successfully added
      */
-    private boolean addClassPackage( String name, StringBuffer packages )
+    private void addClassPackage( String name, StringBuffer packages )
     {
-        boolean isAdded = false;
-
         int idx = name.lastIndexOf( '/' );
         if ( idx > 0 )
         {
@@ -193,10 +188,7 @@
             {
                 packages.append( packageName ).append( "\n" );
             }
-            isAdded = true;
         }
-
-        return isAdded;
     }
 
     /**
@@ -204,9 +196,8 @@
      *
      * @param entry the zip entry to be added
      * @param files the buffer of files to update
-     * @return true if the file was successfully added
      */
-    private boolean addFile( ZipEntry entry, StringBuffer files )
+    private void addFile( ZipEntry entry, StringBuffer files )
     {
         String name = entry.getName();
         int idx = name.lastIndexOf( '/' );
@@ -215,14 +206,9 @@
             name = name.substring( idx + 1 );
         }
 
-        boolean isAdded = false;
-
         if ( files.indexOf( name + "\n" ) < 0 )
         {
             files.append( name ).append( "\n" );
-            isAdded = true;
         }
-
-        return isAdded;
     }
 }

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexSearcher.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexSearcher.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexSearcher.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexSearcher.java Tue Jun  6 22:47:45 2006
@@ -103,6 +103,10 @@
             Hits hits = searcher.search( luceneQuery );
             docs = buildList( hits );
         }
+        catch ( MalformedURLException e )
+        {
+            throw new RepositoryIndexSearchException( "Unable to search index: " + e.getMessage(), e );
+        }
         catch ( IOException e )
         {
             throw new RepositoryIndexSearchException( "Unable to search index: " + e.getMessage(), e );
@@ -168,17 +172,15 @@
     protected RepositoryIndexSearchHit createSearchedObjectFromIndexDocument( Document doc )
         throws MalformedURLException, IOException, XmlPullParserException
     {
-        String groupId, artifactId, version, name, packaging;
         RepositoryIndexSearchHit searchHit = null;
 
         // the document is of type artifact
         if ( doc.get( RepositoryIndex.FLD_DOCTYPE ).equals( RepositoryIndex.ARTIFACT ) )
         {
-            groupId = doc.get( RepositoryIndex.FLD_GROUPID );
-            artifactId = doc.get( RepositoryIndex.FLD_ARTIFACTID );
-            version = doc.get( RepositoryIndex.FLD_VERSION );
-            name = doc.get( RepositoryIndex.FLD_NAME );
-            packaging = doc.get( RepositoryIndex.FLD_PACKAGING );
+            String groupId = doc.get( RepositoryIndex.FLD_GROUPID );
+            String artifactId = doc.get( RepositoryIndex.FLD_ARTIFACTID );
+            String version = doc.get( RepositoryIndex.FLD_VERSION );
+            String packaging = doc.get( RepositoryIndex.FLD_PACKAGING );
             Artifact artifact = factory.createBuildArtifact( groupId, artifactId, version, packaging );
 
             artifact.setFile(
@@ -224,7 +226,7 @@
             String metadataFile = (String) it.next();
             String tmpDir = (String) it.next();
 
-            String metadataType = "";
+            String metadataType;
             if ( tmpDir.equals( doc.get( RepositoryIndex.FLD_VERSION ) ) )
             {
                 metadataType = MetadataRepositoryIndex.SNAPSHOT_METADATA;
@@ -258,16 +260,17 @@
      * @param filename     the name of the metadata file
      * @param metadataType the type of RepositoryMetadata object to be created (GROUP, ARTIFACT or SNAPSHOT)
      * @return RepositoryMetadata
-     * @throws MalformedURLException
      * @throws IOException
      * @throws XmlPullParserException
      */
     private RepositoryMetadata getMetadata( String groupId, String artifactId, String version, String filename,
                                             String metadataType )
-        throws MalformedURLException, IOException, XmlPullParserException
+        throws IOException, XmlPullParserException
     {
         RepositoryMetadata repoMetadata = null;
-        InputStream is = null;
+
+        // TODO! file handles left open
+        InputStream is;
         MetadataXpp3Reader metadataReader = new MetadataXpp3Reader();
 
         //group metadata

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexingFactory.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexingFactory.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexingFactory.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/DefaultRepositoryIndexingFactory.java Tue Jun  6 22:47:45 2006
@@ -1,14 +1,13 @@
 package org.apache.maven.repository.indexing;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
-
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java Tue Jun  6 22:47:45 2006
@@ -67,10 +67,8 @@
      * @param indexPath  the path where the lucene index will be created/updated.
      * @param repository the repository where the indexed artifacts are located
      * @param digester   the digester object to generate the checksum strings
-     * @throws RepositoryIndexException
      */
     public EclipseRepositoryIndex( String indexPath, ArtifactRepository repository, Digester digester )
-        throws RepositoryIndexException
     {
         super( indexPath, repository );
 

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java Tue Jun  6 22:47:45 2006
@@ -45,10 +45,8 @@
      *
      * @param indexPath  the path to the index
      * @param repository the repository where the metadata to be indexed is located
-     * @throws RepositoryIndexException
      */
     public MetadataRepositoryIndex( String indexPath, ArtifactRepository repository )
-        throws RepositoryIndexException
     {
         super( indexPath, repository );
     }
@@ -105,7 +103,7 @@
                 repoMetadata.getBaseVersion() + "/";
         }
 
-        if ( !repoMetadata.getRemoteFilename().equals( "" ) && repoMetadata.getRemoteFilename() != null )
+        if ( !"".equals( repoMetadata.getRemoteFilename() ) && repoMetadata.getRemoteFilename() != null )
         {
             path = path + repoMetadata.getRemoteFilename();
         }
@@ -130,7 +128,7 @@
         for ( Iterator iter = plugins.iterator(); iter.hasNext(); )
         {
             Plugin plugin = (Plugin) iter.next();
-            if ( plugin.getPrefix() != null && !plugin.getPrefix().equals( "" ) )
+            if ( plugin.getPrefix() != null && !"".equals( plugin.getPrefix() ) )
             {
                 pluginAppended = plugin.getPrefix() + "\n";
             }
@@ -138,7 +136,7 @@
         doc.add( Field.Text( FLD_PLUGINPREFIX, pluginAppended ) );
         doc.add( Field.Text( FLD_GROUPID, metadata.getGroupId() ) );
 
-        if ( metadata.getArtifactId() != null && !metadata.getArtifactId().equals( "" ) )
+        if ( metadata.getArtifactId() != null && !"".equals( metadata.getArtifactId() ) )
         {
             doc.add( Field.Text( FLD_ARTIFACTID, metadata.getArtifactId() ) );
         }
@@ -147,7 +145,7 @@
             doc.add( Field.Text( FLD_ARTIFACTID, "" ) );
         }
 
-        if ( metadata.getVersion() != null && !metadata.getVersion().equals( "" ) )
+        if ( metadata.getVersion() != null && !"".equals( metadata.getVersion() ) )
         {
             doc.add( Field.Text( FLD_VERSION, metadata.getVersion() ) );
         }

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java Tue Jun  6 22:47:45 2006
@@ -1,14 +1,13 @@
 package org.apache.maven.repository.indexing;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
-
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,6 +30,7 @@
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.security.NoSuchAlgorithmException;
 import java.util.Iterator;
@@ -55,11 +55,9 @@
      * @param repository      the repository where objects indexed by this class resides
      * @param digester        the digester to be used for generating checksums
      * @param artifactFactory the factory for building artifact objects
-     * @throws RepositoryIndexException
      */
     public PomRepositoryIndex( String indexPath, ArtifactRepository repository, Digester digester,
                                ArtifactFactory artifactFactory )
-        throws RepositoryIndexException
     {
         super( indexPath, repository );
         this.digester = digester;
@@ -265,6 +263,10 @@
         try
         {
             return digester.createChecksum( new File( file ), algorithm );
+        }
+        catch ( FileNotFoundException e )
+        {
+            throw new RepositoryIndexException( e.getMessage(), e );
         }
         catch ( IOException e )
         {

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java Tue Jun  6 22:47:45 2006
@@ -27,59 +27,58 @@
  */
 public interface RepositoryIndex
 {
-    static final String POM = "POM";
+    String POM = "POM";
 
-    static final String METADATA = "METADATA";
+    String METADATA = "METADATA";
 
-    static final String ARTIFACT = "ARTIFACT";
+    String ARTIFACT = "ARTIFACT";
 
-    static final String FLD_ID = "id";
+    String FLD_ID = "id";
 
-    static final String FLD_NAME = "name";
+    String FLD_NAME = "name";
 
-    static final String FLD_DOCTYPE = "doctype";
+    String FLD_DOCTYPE = "doctype";
 
-    static final String FLD_GROUPID = "groupId";
+    String FLD_GROUPID = "groupId";
 
-    static final String FLD_ARTIFACTID = "artifactId";
+    String FLD_ARTIFACTID = "artifactId";
 
-    static final String FLD_VERSION = "version";
+    String FLD_VERSION = "version";
 
-    static final String FLD_PACKAGING = "packaging";
+    String FLD_PACKAGING = "packaging";
 
-    static final String FLD_SHA1 = "sha1";
+    String FLD_SHA1 = "sha1";
 
-    static final String FLD_MD5 = "md5";
+    String FLD_MD5 = "md5";
 
-    static final String FLD_LASTUPDATE = "last update";
+    String FLD_LASTUPDATE = "last update";
 
-    static final String FLD_PLUGINPREFIX = "plugin prefix";
+    String FLD_PLUGINPREFIX = "plugin prefix";
 
-    static final String FLD_CLASSES = "class";
+    String FLD_CLASSES = "class";
 
-    static final String FLD_PACKAGES = "package";
+    String FLD_PACKAGES = "package";
 
-    static final String FLD_FILES = "file";
+    String FLD_FILES = "file";
 
-    static final String FLD_LICENSE_URLS = "license url";
+    String FLD_LICENSE_URLS = "license url";
 
-    static final String FLD_DEPENDENCIES = "dependency";
+    String FLD_DEPENDENCIES = "dependency";
 
-    static final String FLD_PLUGINS_BUILD = "build plugin";
+    String FLD_PLUGINS_BUILD = "build plugin";
 
-    static final String FLD_PLUGINS_REPORT = "report plugin";
+    String FLD_PLUGINS_REPORT = "report plugin";
 
-    static final String FLD_PLUGINS_ALL = "plugins_all";
+    String FLD_PLUGINS_ALL = "plugins_all";
 
-    static final String[] FIELDS = {FLD_ID, FLD_NAME, FLD_DOCTYPE, FLD_GROUPID, FLD_ARTIFACTID, FLD_VERSION,
-        FLD_PACKAGING, FLD_SHA1, FLD_MD5, FLD_LASTUPDATE, FLD_PLUGINPREFIX, FLD_CLASSES, FLD_PACKAGES, FLD_FILES,
-        FLD_LICENSE_URLS, FLD_DEPENDENCIES, FLD_PLUGINS_BUILD, FLD_PLUGINS_REPORT, FLD_PLUGINS_ALL};
+    String[] FIELDS = {FLD_ID, FLD_NAME, FLD_DOCTYPE, FLD_GROUPID, FLD_ARTIFACTID, FLD_VERSION, FLD_PACKAGING, FLD_SHA1,
+        FLD_MD5, FLD_LASTUPDATE, FLD_PLUGINPREFIX, FLD_CLASSES, FLD_PACKAGES, FLD_FILES, FLD_LICENSE_URLS,
+        FLD_DEPENDENCIES, FLD_PLUGINS_BUILD, FLD_PLUGINS_REPORT, FLD_PLUGINS_ALL};
 
-    static final List KEYWORD_FIELDS = Arrays.asList( new String[]{FLD_ID, FLD_PACKAGING, FLD_LICENSE_URLS,
-        FLD_DEPENDENCIES, FLD_PLUGINS_BUILD, FLD_PLUGINS_REPORT, FLD_PLUGINS_ALL} );
+    List KEYWORD_FIELDS = Arrays.asList( new String[]{FLD_ID, FLD_PACKAGING, FLD_LICENSE_URLS, FLD_DEPENDENCIES,
+        FLD_PLUGINS_BUILD, FLD_PLUGINS_REPORT, FLD_PLUGINS_ALL} );
 
-    static final String[] MODEL_FIELDS =
-        {FLD_PACKAGING, FLD_LICENSE_URLS, FLD_DEPENDENCIES, FLD_PLUGINS_BUILD, FLD_PLUGINS_REPORT};
+    String[] MODEL_FIELDS = {FLD_PACKAGING, FLD_LICENSE_URLS, FLD_DEPENDENCIES, FLD_PLUGINS_BUILD, FLD_PLUGINS_REPORT};
 
     /**
      * Method used to query the index status

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchHit.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchHit.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchHit.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchHit.java Tue Jun  6 22:47:45 2006
@@ -23,11 +23,11 @@
 {
     private Object obj;
 
-    private boolean isHashMap = false;
+    private boolean isHashMap;
 
-    private boolean isMetadata = false;
+    private boolean isMetadata;
 
-    private boolean isModel = false;
+    private boolean isModel;
 
     /**
      * Class constructor

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayer.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayer.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayer.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayer.java Tue Jun  6 22:47:45 2006
@@ -18,7 +18,6 @@
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.repository.metadata.RepositoryMetadata;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.License;
 import org.apache.maven.model.Model;
@@ -144,7 +143,7 @@
             else if ( hit.isMetadata() )
             {
                 //@todo what about metadata objects?
-                RepositoryMetadata metadata = (RepositoryMetadata) hit.getObject();
+//                RepositoryMetadata metadata = (RepositoryMetadata) hit.getObject();
             }
         }
 
@@ -212,7 +211,7 @@
             }
         }
 
-        if ( values != null && values.size() > 0 )
+        if ( !values.isEmpty() )
         {
             resultMap.put( key, values );
         }
@@ -351,7 +350,7 @@
             }
         }
 
-        if ( values.size() > 0 && values != null )
+        if ( !values.isEmpty() )
         {
             map.put( field, values );
         }

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexingFactory.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexingFactory.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexingFactory.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndexingFactory.java Tue Jun  6 22:47:45 2006
@@ -1,14 +1,13 @@
 package org.apache.maven.repository.indexing;
 
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
-
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/Query.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/Query.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/Query.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/Query.java Tue Jun  6 22:47:45 2006
@@ -1,17 +1,13 @@
 package org.apache.maven.repository.indexing.query;
 
-import org.apache.lucene.queryParser.ParseException;
-import org.apache.maven.repository.indexing.RepositoryIndex;
-
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
- 
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -19,6 +15,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+import org.apache.lucene.queryParser.ParseException;
+import org.apache.maven.repository.indexing.RepositoryIndex;
 
 /**
  * Interface to label the query classes

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/SinglePhraseQuery.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/SinglePhraseQuery.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/SinglePhraseQuery.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/query/SinglePhraseQuery.java Tue Jun  6 22:47:45 2006
@@ -1,20 +1,13 @@
 package org.apache.maven.repository.indexing.query;
 
-import org.apache.lucene.index.Term;
-import org.apache.lucene.queryParser.ParseException;
-import org.apache.lucene.queryParser.QueryParser;
-import org.apache.lucene.search.TermQuery;
-import org.apache.maven.repository.indexing.RepositoryIndex;
-
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
- 
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,6 +15,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+import org.apache.lucene.index.Term;
+import org.apache.lucene.queryParser.ParseException;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.TermQuery;
+import org.apache.maven.repository.indexing.RepositoryIndex;
 
 /**
  * Class to hold a single field search condition

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndexingTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndexingTest.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndexingTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndexingTest.java Tue Jun  6 22:47:45 2006
@@ -422,7 +422,7 @@
         try
         {
             Query qry = new SinglePhraseQuery( RepositoryIndex.FLD_VERSION, "~~~~~" );
-            List artifacts = repoSearchLayer.searchAdvanced( qry );
+            repoSearchLayer.searchAdvanced( qry );
             fail( "Must throw an exception on unparseable query." );
         }
         catch ( RepositoryIndexSearchException re )
@@ -436,7 +436,7 @@
         try
         {
             Query qry = new SinglePhraseQuery( RepositoryIndex.FLD_VERSION, "1.0" );
-            List artifacts = repoSearchLayer.searchAdvanced( qry );
+            repoSearchLayer.searchAdvanced( qry );
             fail( "Must throw an exception on invalid index location." );
         }
         catch ( RepositoryIndexSearchException re )
@@ -466,7 +466,7 @@
         RepositoryIndexSearcher repoSearcher = factory.createDefaultRepositoryIndexSearcher( indexer );
         Query qry = new SinglePhraseQuery( RepositoryIndex.FLD_ID, RepositoryIndex.ARTIFACT + artifact.getId() );
         List artifacts = repoSearcher.search( qry );
-        assertEquals( artifacts.size(), 0 );
+        assertEquals( 0, artifacts.size() );
     }
 
     /**

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/EclipseRepositoryIndexTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/EclipseRepositoryIndexTest.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/EclipseRepositoryIndexTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/EclipseRepositoryIndexTest.java Tue Jun  6 22:47:45 2006
@@ -1,5 +1,21 @@
 package org.apache.maven.repository.indexing;
 
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.apache.lucene.document.DateField;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.queryParser.QueryParser;
@@ -17,22 +33,6 @@
 
 import java.io.File;
 
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 /**
  * @author Edwin Punzalan
  */
@@ -49,6 +49,8 @@
 
     private long artifactFileTime;
 
+    private static final long TIME_DIFFERENCE = 10000L;
+
     protected void setUp()
         throws Exception
     {
@@ -84,7 +86,7 @@
         indexer.optimize();
         indexer.close();
 
-        long historicTime = artifactFileTime - 10000L;
+        long historicTime = artifactFileTime - TIME_DIFFERENCE;
 
         artifact = getArtifact( "org.apache.maven", "maven-model", "2.0" );
         artifact.setFile( new File( repository.getBasedir(), repository.pathOf( artifact ) ) );

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/MetadataRepositoryIndexingTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/MetadataRepositoryIndexingTest.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/MetadataRepositoryIndexingTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/MetadataRepositoryIndexingTest.java Tue Jun  6 22:47:45 2006
@@ -52,8 +52,6 @@
 
     private String indexPath;
 
-    private MetadataRepositoryIndex indexer;
-
     private ArtifactFactory artifactFactory;
 
     /**
@@ -98,7 +96,7 @@
         throws Exception
     {
         RepositoryIndexingFactory factory = (RepositoryIndexingFactory) lookup( RepositoryIndexingFactory.ROLE );
-        indexer = factory.createMetadataRepositoryIndex( indexPath, repository );
+        MetadataRepositoryIndex indexer = factory.createMetadataRepositoryIndex( indexPath, repository );
 
         RepositoryMetadata repoMetadata =
             getMetadata( "org.apache.maven", null, null, "maven-metadata.xml", MetadataRepositoryIndex.GROUP_METADATA );
@@ -140,8 +138,7 @@
         RepositoryIndexSearchLayer repoSearchLayer = factory.createRepositoryIndexSearchLayer( indexer );
 
         // search last update
-        org.apache.maven.repository.indexing.query.Query qry =
-            new SinglePhraseQuery( RepositoryIndex.FLD_LASTUPDATE, "20051212044643" );
+        Query qry = new SinglePhraseQuery( RepositoryIndex.FLD_LASTUPDATE, "20051212044643" );
         List metadataList = repoSearchLayer.searchAdvanced( qry );
         //assertEquals( 1, metadataList.size() );
         for ( Iterator iter = metadataList.iterator(); iter.hasNext(); )
@@ -204,7 +201,7 @@
         rQry.addQuery( qry2 );
 
         metadataList = repoSearchLayer.searchAdvanced( rQry );
-        assertEquals( metadataList.size(), 0 );
+        assertEquals( 0, metadataList.size() );
 
         indexer.close();
     }
@@ -219,7 +216,7 @@
     {
         //test when the object passed in the index(..) method is not a RepositoryMetadata instance
         RepositoryIndexingFactory factory = (RepositoryIndexingFactory) lookup( RepositoryIndexingFactory.ROLE );
-        indexer = factory.createMetadataRepositoryIndex( indexPath, repository );
+        MetadataRepositoryIndex indexer = factory.createMetadataRepositoryIndex( indexPath, repository );
         try
         {
             Artifact artifact = getArtifact( "org.apache.maven", "maven-artifact", "2.0.1" );
@@ -255,17 +252,16 @@
         createTestIndex();
 
         RepositoryIndexingFactory factory = (RepositoryIndexingFactory) lookup( RepositoryIndexingFactory.ROLE );
-        indexer = factory.createMetadataRepositoryIndex( indexPath, repository );
+        MetadataRepositoryIndex indexer = factory.createMetadataRepositoryIndex( indexPath, repository );
 
         RepositoryMetadata repoMetadata =
             getMetadata( "org.apache.maven", null, null, "maven-metadata.xml", MetadataRepositoryIndex.GROUP_METADATA );
         indexer.deleteDocument( RepositoryIndex.FLD_ID, (String) repoMetadata.getKey() );
 
         RepositoryIndexSearcher repoSearcher = factory.createDefaultRepositoryIndexSearcher( indexer );
-        org.apache.maven.repository.indexing.query.Query qry =
-            new SinglePhraseQuery( RepositoryIndex.FLD_ID, (String) repoMetadata.getKey() );
+        Query qry = new SinglePhraseQuery( RepositoryIndex.FLD_ID, (String) repoMetadata.getKey() );
         List metadataList = repoSearcher.search( qry );
-        assertEquals( metadataList.size(), 0 );
+        assertEquals( 0, metadataList.size() );
     }
 
     /**
@@ -285,7 +281,7 @@
     {
         RepositoryMetadata repoMetadata = null;
         URL url;
-        InputStream is = null;
+        InputStream is;
         MetadataXpp3Reader metadataReader = new MetadataXpp3Reader();
 
         //group metadata

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/PomRepositoryIndexingTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/PomRepositoryIndexingTest.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/PomRepositoryIndexingTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/PomRepositoryIndexingTest.java Tue Jun  6 22:47:45 2006
@@ -1,6 +1,6 @@
 package org.apache.maven.repository.indexing;
 
-/**
+/*
  * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -180,10 +180,6 @@
             SearchResult result = (SearchResult) artifacts.next();
             Map map = result.getFieldMatches();
             Set mapEntry = map.entrySet();
-            for ( Iterator it = mapEntry.iterator(); it.hasNext(); )
-            {
-                Map.Entry entry = (Map.Entry) it.next();
-            }
             assertEquals( "jar", (String) map.get( RepositoryIndex.FLD_PACKAGING ) );
         }
 
@@ -212,7 +208,8 @@
             SearchResult result = (SearchResult) artifacts.next();
             Map map = result.getFieldMatches();
             boolean depFound = false;
-            Iterator dependencies = ( (List) map.get( RepositoryIndex.FLD_DEPENDENCIES ) ).iterator();
+            List list = (List) map.get( RepositoryIndex.FLD_DEPENDENCIES );
+            Iterator dependencies = list.iterator();
             while ( dependencies.hasNext() )
             {
                 String dep = (String) dependencies.next();
@@ -234,7 +231,8 @@
         {
             SearchResult result = (SearchResult) artifacts.next();
             Map map = result.getFieldMatches();
-            Iterator plugins = ( (List) map.get( RepositoryIndex.FLD_PLUGINS_BUILD ) ).iterator();
+            List list = (List) map.get( RepositoryIndex.FLD_PLUGINS_BUILD );
+            Iterator plugins = list.iterator();
             boolean found = false;
             while ( plugins.hasNext() )
             {
@@ -257,7 +255,8 @@
         {
             SearchResult result = (SearchResult) artifacts.next();
             Map map = result.getFieldMatches();
-            Iterator plugins = ( (List) map.get( RepositoryIndex.FLD_PLUGINS_REPORT ) ).iterator();
+            List list = (List) map.get( RepositoryIndex.FLD_PLUGINS_REPORT );
+            Iterator plugins = list.iterator();
             boolean found = false;
             while ( plugins.hasNext() )
             {
@@ -485,7 +484,7 @@
         RepositoryIndexSearcher repoSearcher = factory.createDefaultRepositoryIndexSearcher( indexer );
         Query qry = new SinglePhraseQuery( RepositoryIndex.FLD_ID, RepositoryIndex.POM + pom.getId() );
         List artifactList = repoSearcher.search( qry );
-        assertEquals( artifactList.size(), 0 );
+        assertEquals( 0, artifactList.size() );
     }
 
     private Model getPom( String groupId, String artifactId, String version )

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayerTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayerTest.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayerTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/RepositoryIndexSearchLayerTest.java Tue Jun  6 22:47:45 2006
@@ -28,8 +28,6 @@
 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.repository.digest.DefaultDigester;
-import org.apache.maven.repository.digest.Digester;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.util.FileUtils;
 
@@ -54,8 +52,6 @@
 
     private ArtifactFactory artifactFactory;
 
-    private Digester digester;
-
     private String indexPath;
 
     /**
@@ -72,24 +68,12 @@
         ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" );
         ArtifactRepositoryFactory repoFactory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE );
         repository = repoFactory.createArtifactRepository( "test", repoDir, layout, null, null );
-        digester = new DefaultDigester();
 
         indexPath = "target/index";
         FileUtils.deleteDirectory( indexPath );
     }
 
     /**
-     * Tear down method
-     *
-     * @throws Exception
-     */
-    protected void tearDown()
-        throws Exception
-    {
-        super.tearDown();
-    }
-
-    /**
      * Method for creating the index used for testing
      *
      * @throws Exception
@@ -126,24 +110,24 @@
 
         MetadataRepositoryIndex metaIndexer = factory.createMetadataRepositoryIndex( indexPath, repository );
         RepositoryMetadata repoMetadata =
-            getMetadata( "org.apache.maven", null, null, "maven-metadata.xml", metaIndexer.GROUP_METADATA );
+            getMetadata( "org.apache.maven", null, null, "maven-metadata.xml", MetadataRepositoryIndex.GROUP_METADATA );
         metaIndexer.index( repoMetadata );
         metaIndexer.optimize();
         metaIndexer.close();
 
         repoMetadata = getMetadata( "org.apache.maven", "maven-artifact", "2.0.1", "maven-metadata.xml",
-                                    metaIndexer.ARTIFACT_METADATA );
+                                    MetadataRepositoryIndex.ARTIFACT_METADATA );
         metaIndexer.index( repoMetadata );
         metaIndexer.optimize();
         metaIndexer.close();
 
         repoMetadata = getMetadata( "org.apache.maven", "maven-artifact", "2.0.1", "maven-metadata.xml",
-                                    metaIndexer.SNAPSHOT_METADATA );
+                                    MetadataRepositoryIndex.SNAPSHOT_METADATA );
         metaIndexer.index( repoMetadata );
         metaIndexer.optimize();
         metaIndexer.close();
 
-        repoMetadata = getMetadata( "test", null, null, "maven-metadata.xml", metaIndexer.GROUP_METADATA );
+        repoMetadata = getMetadata( "test", null, null, "maven-metadata.xml", MetadataRepositoryIndex.GROUP_METADATA );
         metaIndexer.index( repoMetadata );
         metaIndexer.optimize();
         metaIndexer.close();
@@ -345,14 +329,14 @@
         for ( Iterator iter = returnList.iterator(); iter.hasNext(); )
         {
             SearchResult result = (SearchResult) iter.next();
-            assertEquals( result.getArtifact().getGroupId(), "test" );
+            assertEquals( "test", result.getArtifact().getGroupId() );
         }
 
         returnList = searchLayer.searchGeneral( "test-artifactId" );
         for ( Iterator iter = returnList.iterator(); iter.hasNext(); )
         {
             SearchResult result = (SearchResult) iter.next();
-            assertEquals( result.getArtifact().getArtifactId(), "test-artifactId" );
+            assertEquals( "test-artifactId", result.getArtifact().getArtifactId() );
         }
 
     }
@@ -375,7 +359,7 @@
     {
         RepositoryMetadata repoMetadata = null;
         URL url;
-        InputStream is = null;
+        InputStream is;
         MetadataXpp3Reader metadataReader = new MetadataXpp3Reader();
 
         //group metadata

Modified: maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/query/QueryTest.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/query/QueryTest.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/query/QueryTest.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/test/java/org/apache/maven/repository/indexing/query/QueryTest.java Tue Jun  6 22:47:45 2006
@@ -1,16 +1,13 @@
 package org.apache.maven.repository.indexing.query;
 
-import junit.framework.TestCase;
-
 /*
- * Copyright 2001-2005 The Apache Software Foundation.
+ * Copyright 2005-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
- 
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,6 +15,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+import junit.framework.TestCase;
 
 /**
  * @author Edwin Punzalan

Modified: maven/repository-manager/trunk/maven-repository-manager-site/pom.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-manager-site/pom.xml?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-manager-site/pom.xml (original)
+++ maven/repository-manager/trunk/maven-repository-manager-site/pom.xml Tue Jun  6 22:47:45 2006
@@ -1,4 +1,21 @@
-<?xml version="1.0"?><project>
+<?xml version="1.0"?>
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project>
   <parent>
     <artifactId>maven-repository-manager</artifactId>
     <groupId>org.apache.maven.repository</groupId>

Modified: maven/repository-manager/trunk/maven-repository-manager-site/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-manager-site/src/site/site.xml?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-manager-site/src/site/site.xml (original)
+++ maven/repository-manager/trunk/maven-repository-manager-site/src/site/site.xml Tue Jun  6 22:47:45 2006
@@ -1,18 +1,34 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
 <project>
   <body>
     <links>
       <item name="Maven" href="http://maven.apache.org/"/>
     </links>
 
-    <menu ref="reports" />
+    <menu ref="reports"/>
 
   </body>
   <skin>
     <groupId>org.apache.maven.skins</groupId>
     <artifactId>maven-stylus-skin</artifactId>
   </skin>
-  <publishDate format="dd MMM yyyy" />
+  <publishDate format="dd MMM yyyy"/>
   <bannerLeft>
     <name>Maven</name>
     <src>http://maven.apache.org/images/apache-maven-project-2.png</src>

Modified: maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java (original)
+++ maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/DefaultProxyManager.java Tue Jun  6 22:47:45 2006
@@ -89,6 +89,8 @@
      */
     private Map failuresCache = new HashMap();
 
+    private static final int MS_PER_SEC = 1000;
+
     public void setConfiguration( ProxyConfiguration config )
     {
         this.config = config;
@@ -413,7 +415,7 @@
                     }
                     else
                     {
-                        long repoTimestamp = target.lastModified() + repository.getCachePeriod() * 1000;
+                        long repoTimestamp = target.lastModified() + repository.getCachePeriod() * MS_PER_SEC;
                         wagon.getIfNewer( path, temp, repoTimestamp );
                     }
 

Modified: maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java?rev=412295&r1=412294&r2=412295&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java (original)
+++ maven/repository-manager/trunk/maven-repository-proxy/src/main/java/org/apache/maven/repository/proxy/ProxyManager.java Tue Jun  6 22:47:45 2006
@@ -29,7 +29,7 @@
  */
 public interface ProxyManager
 {
-    static String ROLE = ProxyManager.class.getName();
+    String ROLE = ProxyManager.class.getName();
 
     /**
      * Used to retrieve a cached path or retrieve one if the cache does not contain it yet.



Mime
View raw message