diff options
author | Brett Porter <brett@apache.org> | 2009-03-17 15:45:22 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2009-03-17 15:45:22 +0000 |
commit | 969828589ebe916effe6b61ad16b34b799c640ec (patch) | |
tree | 941c4635755d3f16259e9e7420c6d55c74d6620f /archiva-modules/archiva-base | |
parent | 8bd81e6d6f21612cbf8c2ba0317cf5e155171575 (diff) | |
download | archiva-969828589ebe916effe6b61ad16b34b799c640ec.tar.gz archiva-969828589ebe916effe6b61ad16b34b799c640ec.zip |
clean up warnings
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755286 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base')
3 files changed, 35 insertions, 63 deletions
diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java index c5a1f0134..e966f85c4 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResultHit.java @@ -49,7 +49,7 @@ public class SearchResultHit private String repositoryId = ""; - private List<String> versions = new ArrayList(); + private List<String> versions = new ArrayList<String>(); private ArchivaArtifact artifact; diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResults.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResults.java index 4fc3e22b7..4fa5d1d35 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResults.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/SearchResults.java @@ -32,9 +32,7 @@ import java.util.Map; */ public class SearchResults { - private List repositories = new ArrayList(); - - private Map<String, SearchResultHit> hits = new HashMap(); + private Map<String, SearchResultHit> hits = new HashMap<String, SearchResultHit>(); private int totalHits; @@ -58,7 +56,7 @@ public class SearchResults */ public List<SearchResultHit> getHits() { - return new ArrayList( hits.values() ); + return new ArrayList<SearchResultHit>( hits.values() ); } public Map<String, SearchResultHit> getHitsMap() @@ -66,21 +64,11 @@ public class SearchResults return hits; } - public List getRepositories() - { - return repositories; - } - public boolean isEmpty() { return hits.isEmpty(); } - public void setRepositories( List repositories ) - { - this.repositories = repositories; - } - public SearchResultLimits getLimits() { return limits; diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java index 8eba80c1f..b77840150 100644 --- a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java @@ -179,6 +179,7 @@ public class ArchivaModelCloner return cloned; } + @SuppressWarnings("unchecked") public static Properties clone( Properties properties ) { if ( properties == null ) @@ -188,7 +189,7 @@ public class ArchivaModelCloner Properties cloned = new Properties(); - Enumeration keys = properties.propertyNames(); + Enumeration<String> keys = (Enumeration<String>) properties.propertyNames(); while ( keys.hasMoreElements() ) { String key = (String) keys.nextElement(); @@ -246,39 +247,34 @@ public class ArchivaModelCloner return cloned; } - public static List cloneArtifactReferences( List artifactReferenceList ) + public static List<ArtifactReference> cloneArtifactReferences( List<ArtifactReference> artifactReferenceList ) { if ( artifactReferenceList == null ) { return null; } - List ret = new ArrayList(); + List<ArtifactReference> ret = new ArrayList<ArtifactReference>(); - Iterator it = artifactReferenceList.iterator(); - while ( it.hasNext() ) + for ( ArtifactReference ref : artifactReferenceList ) { - ArtifactReference artifactReference = (ArtifactReference) it.next(); - ret.add( clone( artifactReference ) ); + ret.add( clone( ref ) ); } return ret; } - public static List cloneDependencies( List dependencies ) + public static List<Dependency> cloneDependencies( List<Dependency> dependencies ) { if ( dependencies == null ) { return null; } - List ret = new ArrayList(); + List<Dependency> ret = new ArrayList<Dependency>(); - Iterator it = dependencies.iterator(); - while ( it.hasNext() ) + for ( Dependency dep : dependencies ) { - Dependency dep = (Dependency) it.next(); - if ( dep == null ) { // Skip null dependency. @@ -291,19 +287,17 @@ public class ArchivaModelCloner return ret; } - public static List cloneExclusions( List exclusions ) + public static List<Exclusion> cloneExclusions( List<Exclusion> exclusions ) { if ( exclusions == null ) { return null; } - List ret = new ArrayList(); + List<Exclusion> ret = new ArrayList<Exclusion>(); - Iterator it = exclusions.iterator(); - while ( it.hasNext() ) + for ( Exclusion exclusion : exclusions ) { - Exclusion exclusion = (Exclusion) it.next(); Exclusion cloned = new Exclusion(); cloned.setGroupId( exclusion.getGroupId() ); @@ -315,19 +309,19 @@ public class ArchivaModelCloner return ret; } - public static List cloneIndividuals( List individuals ) + public static List<Individual> cloneIndividuals( List<Individual> individuals ) { if ( individuals == null ) { return individuals; } - List ret = new ArrayList(); + List<Individual> ret = new ArrayList<Individual>(); - Iterator it = individuals.iterator(); + Iterator<Individual> it = individuals.iterator(); while ( it.hasNext() ) { - Individual individual = (Individual) it.next(); + Individual individual = it.next(); Individual cloned = new Individual(); cloned.setPrincipal( individual.getPrincipal() ); @@ -348,19 +342,17 @@ public class ArchivaModelCloner return ret; } - public static List cloneLicenses( List licenses ) + public static List<License> cloneLicenses( List<License> licenses ) { if ( licenses == null ) { return null; } - List ret = new ArrayList(); + List<License> ret = new ArrayList<License>(); - Iterator it = licenses.iterator(); - while ( it.hasNext() ) + for ( License license : licenses ) { - License license = (License) it.next(); License cloned = new License(); cloned.setId( license.getId() ); @@ -374,20 +366,17 @@ public class ArchivaModelCloner return ret; } - public static List cloneMailingLists( List mailingLists ) + public static List<MailingList> cloneMailingLists( List<MailingList> mailingLists ) { if ( mailingLists == null ) { return null; } - List ret = new ArrayList(); + List<MailingList> ret = new ArrayList<MailingList>(); - Iterator it = mailingLists.iterator(); - while ( it.hasNext() ) + for ( MailingList mailingList : mailingLists ) { - MailingList mailingList = (MailingList) it.next(); - if ( mailingList == null ) { // Skip null mailing list. @@ -400,29 +389,27 @@ public class ArchivaModelCloner return ret; } - public static List clonePlugins( List plugins ) + public static List<ArtifactReference> clonePlugins( List<ArtifactReference> plugins ) { return cloneArtifactReferences( plugins ); } - public static List cloneReports( List reports ) + public static List<ArtifactReference> cloneReports( List<ArtifactReference> reports ) { return cloneArtifactReferences( reports ); } - public static List cloneRepositories( List repositories ) + public static List<ProjectRepository> cloneRepositories( List<ProjectRepository> repositories ) { if ( repositories == null ) { return null; } - List ret = new ArrayList(); + List<ProjectRepository> ret = new ArrayList<ProjectRepository>(); - Iterator it = repositories.iterator(); - while ( it.hasNext() ) + for ( ProjectRepository repository : repositories ) { - ProjectRepository repository = (ProjectRepository) it.next(); ProjectRepository cloned = new ProjectRepository(); cloned.setId( repository.getId() ); @@ -439,32 +426,29 @@ public class ArchivaModelCloner return ret; } - public static List cloneRoles( List roles ) + public static List<String> cloneRoles( List<String> roles ) { return cloneSimpleStringList( roles ); } - private static List cloneSimpleStringList( List simple ) + private static List<String> cloneSimpleStringList( List<String> simple ) { if ( simple == null ) { return null; } - List ret = new ArrayList(); + List<String> ret = new ArrayList<String>(); - Iterator it = simple.iterator(); - - while ( it.hasNext() ) + for ( String txt : simple ) { - String txt = (String) it.next(); ret.add( txt ); } return ret; } - public static List cloneAvailableVersions( List availableVersions ) + public static List<String> cloneAvailableVersions( List<String> availableVersions ) { return cloneSimpleStringList( availableVersions ); } |