diff options
author | Brett Porter <brett@apache.org> | 2006-06-28 05:45:08 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2006-06-28 05:45:08 +0000 |
commit | 7a5b4547afed45765c84495ad434a36fcba6352d (patch) | |
tree | ef1ae69784ef12539033c2fef6976a307be4f91a /maven-repository-indexer | |
parent | e0182bf24e3da80266b5545b6e7578e79acc9a09 (diff) | |
download | archiva-7a5b4547afed45765c84495ad434a36fcba6352d.tar.gz archiva-7a5b4547afed45765c84495ad434a36fcba6352d.zip |
clean up some issues and bugs highlighted by inspections
git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@417674 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'maven-repository-indexer')
2 files changed, 35 insertions, 35 deletions
diff --git a/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java b/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java index 30ea608b2..2b9af2822 100644 --- a/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java +++ b/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java @@ -20,19 +20,19 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CharTokenizer; import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.document.Document; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; -import org.apache.lucene.document.Document; import org.apache.maven.artifact.repository.ArtifactRepository; import java.io.File; import java.io.IOException; import java.io.Reader; import java.util.Collection; -import java.util.List; -import java.util.Iterator; import java.util.Collections; +import java.util.Iterator; +import java.util.List; import java.util.zip.ZipEntry; /** @@ -71,8 +71,7 @@ public abstract class AbstractRepositoryIndex } catch ( IOException e ) { - throw new RepositoryIndexException( "Failed to validate index path: " + - getIndexPath().getAbsolutePath(), e ); + throw new RepositoryIndexException( "Failed to validate index path: " + indexPath.getAbsolutePath(), e ); } } @@ -148,7 +147,7 @@ public abstract class AbstractRepositoryIndex /** * @see RepositoryIndex#validate() */ - public void validate() + public final void validate() throws RepositoryIndexException, IOException { if ( indexExists() ) @@ -201,7 +200,7 @@ public abstract class AbstractRepositoryIndex } /** - * @see RepositoryIndex#deleteDocuments(java.util.List) + * @see RepositoryIndex#deleteDocuments(java.util.List) */ public void deleteDocuments( List termList ) throws RepositoryIndexException, IOException diff --git a/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java b/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java index 8fb8ff73e..d77c70969 100644 --- a/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java +++ b/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java @@ -26,61 +26,62 @@ import java.util.List; /** * @author Edwin Punzalan + * @todo can we move all of these constants out of the interface? Perhaps they should be an enumerated type? */ 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, + 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, + 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}; ArtifactRepository getRepository(); @@ -117,7 +118,7 @@ public interface RepositoryIndex * * @throws RepositoryIndexException if the given indexPath is not valid for this type of RepositoryIndex */ - public void validate() + void validate() throws RepositoryIndexException, IOException; /** @@ -127,7 +128,7 @@ public interface RepositoryIndex * @param docList List of Lucene Documents * @throws RepositoryIndexException when an error occurred during the indexing of the documents */ - public void addDocuments( List docList ) + void addDocuments( List docList ) throws RepositoryIndexException; /** @@ -137,6 +138,6 @@ public interface RepositoryIndex * @throws RepositoryIndexException * @throws IOException */ - public void deleteDocuments( List termList ) + void deleteDocuments( List termList ) throws RepositoryIndexException, IOException; } |