clean up warnings

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755286 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2009-03-17 15:45:22 +00:00
parent 8bd81e6d6f
commit 969828589e
4 changed files with 38 additions and 65 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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 );
}

View File

@ -24,6 +24,7 @@ import org.apache.maven.archiva.database.ArchivaDatabaseException;
import org.apache.maven.archiva.database.Constraint;
import org.apache.maven.archiva.database.ObjectNotFoundException;
import org.apache.maven.archiva.database.constraints.RepositoryProblemByTypeConstraint;
import org.apache.maven.archiva.model.RepositoryProblem;
import org.apache.maven.archiva.reporting.DataLimits;
import org.apache.maven.archiva.reporting.DynamicReportSource;
@ -59,13 +60,13 @@ public class MetadataReport
constraint = new RepositoryProblemByTypeConstraint( PROBLEM_TYPE_METADATA );
}
public List getData()
public List<RepositoryProblem> getData()
throws ObjectNotFoundException, ArchivaDatabaseException
{
return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint );
}
public List getData( DataLimits limits )
public List<RepositoryProblem> getData( DataLimits limits )
throws ObjectNotFoundException, ArchivaDatabaseException
{
// TODO: implement limits.