clean up warnings in reports modules

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755290 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2009-03-17 15:53:37 +00:00
parent ad7be3a3fc
commit 5881fb5829
12 changed files with 21 additions and 20 deletions
archiva-modules/archiva-reporting
archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact
archiva-metadata-reports/src/main/java/org/apache/maven/archiva/reporting/metadata
archiva-project-reports/src/main/java/org/apache/maven/archiva/reporting/project
archiva-report-manager/src

View File

@ -36,7 +36,7 @@ import java.util.List;
* <a href="mailto:oching@apache.org">Maria Odea Ching</a>
*/
public class CorruptArtifactReport
implements DynamicReportSource
implements DynamicReportSource<RepositoryProblem>
{
public static final String PROBLEM_TYPE_CORRUPT_ARTIFACT = "corrupt-artifact";

View File

@ -39,7 +39,7 @@ import java.util.List;
* role-hint="duplicate-artifacts"
*/
public class DuplicateArtifactReport
implements DynamicReportSource
implements DynamicReportSource<RepositoryProblem>
{
public static final String PROBLEM_TYPE_DUPLICATE_ARTIFACTS = "duplicate-artifacts";

View File

@ -39,7 +39,7 @@ import java.util.List;
* role-hint="artifact-location"
*/
public class LocationArtifactsReport
implements DynamicReportSource
implements DynamicReportSource<RepositoryProblem>
{
public static final String PROBLEM_TYPE_BAD_ARTIFACT_LOCATION = "bad-artifact-location";

View File

@ -38,7 +38,7 @@ import org.apache.maven.archiva.reporting.DynamicReportSource;
* role-hint="old-artifacts"
*/
public class OldArtifactReport
implements DynamicReportSource
implements DynamicReportSource<ArchivaArtifact>
{
/**
* @plexus.configuration default-value="Old Artifacts Report"

View File

@ -38,7 +38,7 @@ import org.apache.maven.archiva.reporting.DynamicReportSource;
* role-hint="old-snapshots"
*/
public class OldSnapshotArtifactReport
implements DynamicReportSource
implements DynamicReportSource<ArchivaArtifact>
{
/**
* @plexus.configuration default-value="Old Snapshots Report"

View File

@ -39,7 +39,7 @@ import java.util.List;
* role-hint="metadata"
*/
public class MetadataReport
implements DynamicReportSource
implements DynamicReportSource<RepositoryProblem>
{
public static final String PROBLEM_TYPE_METADATA = "metadata";

View File

@ -39,7 +39,7 @@ import java.util.List;
* role-hint="missing-dependencies"
*/
public class MissingDependenciesReport
implements DynamicReportSource
implements DynamicReportSource<RepositoryProblem>
{
public static final String PROBLEM_TYPE_MISSING_DEPENDENCY = "missing-dependency";

View File

@ -35,14 +35,14 @@ public class DefaultReportingManager
/**
* @plexus.requirement role="org.apache.maven.archiva.reporting.DynamicReportSource"
*/
private Map reportSourceMap;
private Map<String, DynamicReportSource<?>> reportSourceMap;
public DynamicReportSource getReport( String id )
public DynamicReportSource<?> getReport( String id )
{
return (DynamicReportSource) reportSourceMap.get( id );
return reportSourceMap.get( id );
}
public Map getAvailableReports()
public Map<String, DynamicReportSource<?>> getAvailableReports()
{
return reportSourceMap;
}

View File

@ -19,17 +19,17 @@ package org.apache.maven.archiva.reporting;
* under the License.
*/
import java.util.List;
import org.apache.maven.archiva.database.ArchivaDatabaseException;
import org.apache.maven.archiva.database.ObjectNotFoundException;
import java.util.List;
/**
* DynamicReportSource
*
* @version $Id$
*/
public interface DynamicReportSource
public interface DynamicReportSource<T>
{
/**
* The human readable name of this report.
@ -45,7 +45,7 @@ public interface DynamicReportSource
* @throws ArchivaDatabaseException if there was a fundamental issue with accessing the database.
* @throws ObjectNotFoundException if no records were found.
*/
public List getData() throws ObjectNotFoundException, ArchivaDatabaseException;
public List<T> getData() throws ObjectNotFoundException, ArchivaDatabaseException;
/**
* Get the entire list of values for this report.
@ -57,5 +57,5 @@ public interface DynamicReportSource
* @throws ArchivaDatabaseException if there was a fundamental issue with accessing the database.
* @throws ObjectNotFoundException if no records were found.
*/
public List getData( DataLimits limits ) throws ObjectNotFoundException, ArchivaDatabaseException;
public List<T> getData( DataLimits limits ) throws ObjectNotFoundException, ArchivaDatabaseException;
}

View File

@ -28,7 +28,7 @@ import java.util.Map;
*/
public interface ReportingManager
{
public DynamicReportSource getReport( String id );
public DynamicReportSource<?> getReport( String id );
public Map /*<String,DynamicReportSource>*/getAvailableReports();
public Map<String,DynamicReportSource<?>> getAvailableReports();
}

View File

@ -27,6 +27,7 @@ import org.apache.maven.archiva.database.ArchivaDAO;
import org.apache.maven.archiva.database.ArchivaDatabaseException;
import org.apache.maven.archiva.database.ArtifactDAO;
import org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint;
import org.apache.maven.archiva.model.ArchivaArtifact;
import org.apache.maven.archiva.model.RepositoryContentStatistics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -121,7 +122,7 @@ public class SimpleRepositoryStatisticsReportGenerator
try
{
//TODO use the repo content stats whenGathered date instead of endDate for single repo reports
List types = artifactDao.queryArtifacts(
List<ArchivaArtifact> types = artifactDao.queryArtifacts(
new ArtifactsByRepositoryConstraint( repository, JAR_TYPE, endDate, "whenGathered" ) );
repoStatistics.setJarCount( types.size() );

View File

@ -342,7 +342,7 @@ public class SimpleRepositoryStatisticsReportGeneratorTest
try
{
List<RepositoryStatistics> data = generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
fail( "An ArchivaReportException should have been thrown." );
}
catch ( ArchivaReportException a )