]> source.dussan.org Git - archiva.git/commitdiff
clean up warnings in webapp
authorBrett Porter <brett@apache.org>
Tue, 17 Mar 2009 16:53:49 +0000 (16:53 +0000)
committerBrett Porter <brett@apache.org>
Tue, 17 Mar 2009 16:53:49 +0000 (16:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@755318 13f79535-47bb-0310-9956-ffa450edef68

37 files changed:
archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaXworkUser.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/DeleteArtifactAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/PlexusActionSupport.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/SchedulerAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AddAdminDatabaseConsumerClosure.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AdminDatabaseConsumerComparator.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AddAdminRepoConsumerClosure.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AdminRepositoryConsumerComparator.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/mapper/RepositoryActionMapper.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/rss/RssFeedServlet.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaStartup.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DependencyTreeTag.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifactTag.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/PlexusTagUtil.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ContextUtils.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java [deleted file]
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/AbstractWebworkTestCase.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/SearchActionTest.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/OrganizationInfoActionTest.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryArchivaDAOStub.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArchivaDAOStub.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ProjectModelDAOStub.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryContentStatisticsDAOStub.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/ArtifactDAOStub.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/RssFeedServletTest.java

index 88b3f628e0c06c9a79ff7db85085e0214c8f1954..2cdb7f7f943360acdbc8efc67ba908d653ae383a 100644 (file)
@@ -34,7 +34,7 @@ import org.codehaus.plexus.redback.users.UserManager;
  */
 public class ArchivaXworkUser
 {
-    public String getActivePrincipal( Map<String, Object> sessionMap )
+    public String getActivePrincipal( Map<String, ?> sessionMap )
     {
         SecuritySession securitySession =
             (SecuritySession) sessionMap.get( SecuritySystemConstants.SECURITY_SESSION_KEY );
index aebfb1527c8427b596b7f626b8b3eab8f9dab385..b185306c1220877da645c1ab9f40650ed0499fd4 100644 (file)
@@ -204,6 +204,7 @@ public class BrowseAction
         }        
     }
     
+    @SuppressWarnings("unchecked")
     private String getPrincipal()
     {
         return archivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() );
index ff3b1dde1ea825b08e92d3f8950e95a7fb2a2ce4..e20e0b70a57f1d7f8f5f01f3b1a8d3033960c859 100644 (file)
@@ -213,8 +213,6 @@ public class DeleteArtifactAction
             TimeZone timezone = TimeZone.getTimeZone( "UTC" );
             DateFormat fmt = new SimpleDateFormat( "yyyyMMdd.HHmmss" );
             fmt.setTimeZone( timezone );
-            String timestamp = fmt.format( lastUpdatedTimestamp );
-
             ManagedRepositoryConfiguration repoConfig =
                 configuration.getConfiguration().findManagedRepositoryById( repositoryId );
 
@@ -296,6 +294,7 @@ public class DeleteArtifactAction
         }
     }
 
+    @SuppressWarnings("unchecked")
     private String getPrincipal()
     {
         return archivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() );
index de6e508c533fc45664c4c6084095f165b0deb47a..025e4f51a9352de34fcf1db51f600bb7d1e85a6c 100644 (file)
@@ -34,13 +34,13 @@ public abstract class PlexusActionSupport
     extends ActionSupport\r
     implements SessionAware\r
 {\r
-    protected Map session;\r
+    protected Map<?, ?> session;\r
 \r
     protected Logger log = LoggerFactory.getLogger( getClass() );\r
     \r
+    @SuppressWarnings("unchecked")\r
     public void setSession( Map map )\r
     {\r
-        //noinspection AssignmentToCollectionOrArrayFieldFromParameter\r
         this.session = map;\r
     }\r
 }\r
index 9525c7f5396869b65d9b0864cbb2939652c8f46f..869abd5f7e4b8e324a64ea466efbe6250c803f74 100644 (file)
@@ -28,6 +28,8 @@ import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.database.ObjectNotFoundException;
 import org.apache.maven.archiva.database.browsing.RepositoryBrowsing;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
+import org.apache.maven.archiva.model.Dependency;
+import org.apache.maven.archiva.model.MailingList;
 import org.apache.maven.archiva.security.AccessDeniedException;
 import org.apache.maven.archiva.security.ArchivaSecurityException;
 import org.apache.maven.archiva.security.PrincipalNotFoundException;
@@ -85,16 +87,11 @@ public class ShowArtifactAction
     /**
      * The list of artifacts that depend on this versioned project.
      */
-    private List dependees;
+    private List<ArchivaProjectModel> dependees;
 
-    /**
-     * The reports associated with this versioned project.
-     */
-    private List reports;
-
-    private List mailingLists;
+    private List<MailingList> mailingLists;
 
-    private List dependencies;
+    private List<Dependency> dependencies;
     
     private List<String> snapshotVersions;
 
@@ -168,10 +165,8 @@ public class ShowArtifactAction
     public String reports()
         throws ObjectNotFoundException, ArchivaDatabaseException
     {
-        System.out.println( "#### In reports." );
         // TODO: hook up reports on project - this.reports = artifactsDatabase.findArtifactResults( groupId, artifactId,
         // version );
-        System.out.println( "#### Found " + reports.size() + " reports." );
 
         return SUCCESS;
     }
@@ -200,6 +195,7 @@ public class ShowArtifactAction
         return SUCCESS;
     }
 
+    @SuppressWarnings("unchecked")
     private String getPrincipal()
     {
         return archivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() );
@@ -281,22 +277,17 @@ public class ShowArtifactAction
         this.version = version;
     }
 
-    public List getReports()
-    {
-        return reports;
-    }
-
-    public List getMailingLists()
+    public List<MailingList> getMailingLists()
     {
         return mailingLists;
     }
 
-    public List getDependencies()
+    public List<Dependency> getDependencies()
     {
         return dependencies;
     }
 
-    public List getDependees()
+    public List<ArchivaProjectModel> getDependees()
     {
         return dependees;
     }
index 9cc6b5a1a5e249e59c594aca33c0f49fcd5422b4..c39850c1a66de45dc62bdd008821544d89f9d76d 100644 (file)
@@ -120,31 +120,11 @@ public class UploadAction
      */
     private File artifactFile;
 
-    /**
-     * The content type of the artifact to be deployed.
-     */
-    private String artifactContentType;
-
-    /**
-     * The original filename of the uploaded artifact file.
-     */
-    private String artifactFilename;
-
     /**
      * The temporary file representing the pom to be deployed alongside the artifact.
      */
     private File pomFile;
 
-    /**
-     * The content type of the pom file.
-     */
-    private String pomContentType;
-
-    /**
-     * The original filename of the uploaded pom file.
-     */
-    private String pomFilename;
-
     /**
      * The repository where the artifact is to be deployed.
      */
@@ -191,12 +171,12 @@ public class UploadAction
 
     public void setArtifactContentType( String contentType )
     {
-        this.artifactContentType = StringUtils.trim( contentType );
+        StringUtils.trim( contentType );
     }
 
     public void setArtifactFileName( String filename )
     {
-        this.artifactFilename = StringUtils.trim( filename );
+        StringUtils.trim( filename );
     }
 
     public void setPom( File file )
@@ -206,12 +186,12 @@ public class UploadAction
 
     public void setPomContentType( String contentType )
     {
-        this.pomContentType = StringUtils.trim( contentType );
+        StringUtils.trim( contentType );
     }
 
     public void setPomFileName( String filename )
     {
-        this.pomFilename = StringUtils.trim( filename );
+        StringUtils.trim( filename );
     }
 
     public String getGroupId()
@@ -314,11 +294,7 @@ public class UploadAction
         packaging = "";
         classifier = "";
         artifactFile = null;
-        artifactContentType = "";
-        artifactFilename = "";
         pomFile = null;
-        pomContentType = "";
-        pomFilename = "";
         repositoryId = "";
         generatePom = false;
     }
@@ -456,6 +432,7 @@ public class UploadAction
         }
     }
 
+    @SuppressWarnings("unchecked")
     private String getPrincipal()
     {
         return archivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() );
index fa10c51ddf0e24a970002d2e15139fb6b1b36275..f3e6f8332684b1a20ca5a513767eb668db33b2b1 100644 (file)
@@ -43,10 +43,6 @@ public class SchedulerAction
     extends PlexusActionSupport
     implements SecureAction
 {
-    private static final String REPO_SUCCESS = "repoSucces";
-    
-    private static final String DB_SUCCESS = "dbSuccess";
-    
     /**
      * @plexus.requirement
      */
index 26a492b65264794c2cd748f1bdea8f1df3c60799..fddf47e3c0573fa4de906a21789ca5e5d823585c 100644 (file)
@@ -19,7 +19,11 @@ package org.apache.maven.archiva.web.action.admin.connectors.proxy;
  * under the License.
  */
 
-import com.opensymphony.xwork2.Preparable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
 import org.apache.maven.archiva.policies.DownloadErrorPolicy;
@@ -27,11 +31,7 @@ import org.apache.maven.archiva.policies.Policy;
 import org.apache.maven.archiva.policies.PostDownloadPolicy;
 import org.apache.maven.archiva.policies.PreDownloadPolicy;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import com.opensymphony.xwork2.Preparable;
 
 /**
  * AbstractProxyConnectorFormAction - generic fields and methods for either add or edit actions related with the 
@@ -160,6 +160,7 @@ public abstract class AbstractProxyConnectorFormAction
         return INPUT;
     }
 
+    @SuppressWarnings("unchecked")
     public String addProperty()
     {
         String key = getPropertyKey();
@@ -419,6 +420,7 @@ public abstract class AbstractProxyConnectorFormAction
         return new ArrayList<String>( getConfig().getRemoteRepositoriesAsMap().keySet() );
     }
 
+    @SuppressWarnings("unchecked")
     protected void validateConnector()
     {
         if ( connector.getPolicies() == null )
@@ -440,11 +442,9 @@ public abstract class AbstractProxyConnectorFormAction
                     continue;
                 }
 
-                Map properties = connector.getProperties();
-                for ( Iterator j = properties.keySet().iterator(); j.hasNext(); )
+                Map<String, Object> properties = connector.getProperties();
+                for ( String key : properties.keySet() )
                 {
-                    String key = (String) j.next();
-
                     Object value = properties.get( key );
                     if ( value.getClass().isArray() )
                     {
index 64b5677329d341ac3cd977745626ab7b5c14cd4f..c625ec1f151790c624b62cd65595a3f31b6f4d76 100644 (file)
@@ -33,11 +33,11 @@ import java.util.List;
 public class AddAdminDatabaseConsumerClosure
     implements Closure
 {
-    private List list = new ArrayList();
+    private List<AdminDatabaseConsumer> list = new ArrayList<AdminDatabaseConsumer>();
 
-    private List selectedIds;
+    private List<String> selectedIds;
 
-    public AddAdminDatabaseConsumerClosure( List selectedIds )
+    public AddAdminDatabaseConsumerClosure( List<String> selectedIds )
     {
         this.selectedIds = selectedIds;
     }
@@ -59,7 +59,7 @@ public class AddAdminDatabaseConsumerClosure
         }
     }
 
-    public List getList()
+    public List<AdminDatabaseConsumer> getList()
     {
         return list;
     }
index 93ea0abbed5313066f94825789e00255d988cb7e..50746c55cfa69fa7fcbddcb1bc473d21fb04d2b3 100644 (file)
@@ -27,7 +27,7 @@ import java.util.Comparator;
  * @version $Id$
  */
 public class AdminDatabaseConsumerComparator
-    implements Comparator
+    implements Comparator<AdminDatabaseConsumer>
 {
     private static AdminDatabaseConsumerComparator INSTANCE = new AdminDatabaseConsumerComparator();
 
@@ -36,7 +36,7 @@ public class AdminDatabaseConsumerComparator
         return INSTANCE;
     }
 
-    public int compare( Object o1, Object o2 )
+    public int compare( AdminDatabaseConsumer o1, AdminDatabaseConsumer o2 )
     {
         if ( o1 == null && o2 == null )
         {
@@ -53,14 +53,8 @@ public class AdminDatabaseConsumerComparator
             return -1;
         }
 
-        if ( ( o1 instanceof AdminDatabaseConsumer ) && ( o2 instanceof AdminDatabaseConsumer ) )
-        {
-            String id1 = ( (AdminDatabaseConsumer) o1 ).getId();
-            String id2 = ( (AdminDatabaseConsumer) o2 ).getId();
-            return id1.compareToIgnoreCase( id2 );
-        }
-
-        return 0;
+        String id1 = o1.getId();
+        String id2 = o2.getId();
+        return id1.compareToIgnoreCase( id2 );
     }
-
 }
index 0bd57b4f0c6db33455966109488b507fba2c914e..d040980efe350ade04a4ef2fba62e6bacd236111 100644 (file)
@@ -19,7 +19,9 @@ package org.apache.maven.archiva.web.action.admin.database;
  * under the License.
  */
 
-import com.opensymphony.xwork2.Preparable;
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
@@ -27,17 +29,15 @@ import org.apache.maven.archiva.configuration.DatabaseScanningConfiguration;
 import org.apache.maven.archiva.configuration.IndeterminateConfigurationException;
 import org.apache.maven.archiva.database.updater.DatabaseConsumers;
 import org.apache.maven.archiva.security.ArchivaRoleConstants;
-import org.apache.maven.archiva.web.action.admin.scanning.AdminRepositoryConsumerComparator;
 import org.apache.maven.archiva.web.action.PlexusActionSupport;
 import org.codehaus.plexus.redback.rbac.Resource;
 import org.codehaus.plexus.registry.RegistryException;
-
-import java.util.Collections;
-import java.util.List;
 import org.codehaus.redback.integration.interceptor.SecureAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
 
+import com.opensymphony.xwork2.Preparable;
+
 /**
  * DatabaseAction
  *
@@ -63,22 +63,22 @@ public class DatabaseAction
     /**
      * List of available {@link AdminDatabaseConsumer} objects for unprocessed artifacts.
      */
-    private List unprocessedConsumers;
+    private List<AdminDatabaseConsumer> unprocessedConsumers;
 
     /**
      * List of enabled {@link AdminDatabaseConsumer} objects for unprocessed artifacts.
      */
-    private List enabledUnprocessedConsumers;
+    private List<String> enabledUnprocessedConsumers;
 
     /**
      * List of {@link AdminDatabaseConsumer} objects for "to cleanup" artifacts.
      */
-    private List cleanupConsumers;
+    private List<AdminDatabaseConsumer> cleanupConsumers;
 
     /**
      * List of enabled {@link AdminDatabaseConsumer} objects for "to cleanup" artifacts.
      */
-    private List enabledCleanupConsumers;
+    private List<String> enabledCleanupConsumers;
 
     public void prepare()
         throws Exception
@@ -93,12 +93,12 @@ public class DatabaseAction
         addAdminDbConsumer = new AddAdminDatabaseConsumerClosure( dbscanning.getUnprocessedConsumers() );
         CollectionUtils.forAllDo( databaseConsumers.getAvailableUnprocessedConsumers(), addAdminDbConsumer );
         this.unprocessedConsumers = addAdminDbConsumer.getList();
-        Collections.sort( this.unprocessedConsumers, AdminRepositoryConsumerComparator.getInstance() );
+        Collections.sort( this.unprocessedConsumers, AdminDatabaseConsumerComparator.getInstance() );
 
         addAdminDbConsumer = new AddAdminDatabaseConsumerClosure( dbscanning.getCleanupConsumers() );
         CollectionUtils.forAllDo( databaseConsumers.getAvailableCleanupConsumers(), addAdminDbConsumer );
         this.cleanupConsumers = addAdminDbConsumer.getList();
-        Collections.sort( this.cleanupConsumers, AdminRepositoryConsumerComparator.getInstance() );
+        Collections.sort( this.cleanupConsumers, AdminDatabaseConsumerComparator.getInstance() );
     }
 
     public String updateUnprocessedConsumers()
@@ -166,32 +166,32 @@ public class DatabaseAction
         this.cron = cron;
     }
 
-    public List getCleanupConsumers()
+    public List<AdminDatabaseConsumer> getCleanupConsumers()
     {
         return cleanupConsumers;
     }
 
-    public List getUnprocessedConsumers()
+    public List<AdminDatabaseConsumer> getUnprocessedConsumers()
     {
         return unprocessedConsumers;
     }
 
-    public List getEnabledUnprocessedConsumers()
+    public List<String> getEnabledUnprocessedConsumers()
     {
         return enabledUnprocessedConsumers;
     }
 
-    public void setEnabledUnprocessedConsumers( List enabledUnprocessedConsumers )
+    public void setEnabledUnprocessedConsumers( List<String> enabledUnprocessedConsumers )
     {
         this.enabledUnprocessedConsumers = enabledUnprocessedConsumers;
     }
 
-    public List getEnabledCleanupConsumers()
+    public List<String> getEnabledCleanupConsumers()
     {
         return enabledCleanupConsumers;
     }
 
-    public void setEnabledCleanupConsumers( List enabledCleanupConsumers )
+    public void setEnabledCleanupConsumers( List<String> enabledCleanupConsumers )
     {
         this.enabledCleanupConsumers = enabledCleanupConsumers;
     }
index e337a23db25ba5e6112d935fa291c01811a4370f..f85f57cff964f19aa3cd0e96191fabe91ab6ceff 100644 (file)
@@ -49,7 +49,7 @@ public class DeleteLegacyArtifactPathAction
     {\r
         log.info( "remove [" + path + "] from legacy artifact path resolution" );\r
         Configuration configuration = archivaConfiguration.getConfiguration();\r
-        for ( Iterator iterator = configuration.getLegacyArtifactPaths().iterator(); iterator.hasNext(); )\r
+        for ( Iterator<LegacyArtifactPath> iterator = configuration.getLegacyArtifactPaths().iterator(); iterator.hasNext(); )\r
         {\r
             LegacyArtifactPath legacyArtifactPath = (LegacyArtifactPath) iterator.next();\r
             if (legacyArtifactPath.match( path ))\r
index fb71165c10a163333a38a47ff9f6e0ff34db08f9..dcbbe42494a8e108ecb2e85bc05b2e61d2447390 100644 (file)
@@ -22,6 +22,7 @@ package org.apache.maven.archiva.web.action.admin.networkproxies;
 import com.opensymphony.xwork2.Preparable;
 
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.NetworkProxyConfiguration;
 import org.apache.maven.archiva.security.ArchivaRoleConstants;
 import org.apache.maven.archiva.web.action.PlexusActionSupport;
 import org.codehaus.plexus.redback.rbac.Resource;
@@ -47,7 +48,7 @@ public class NetworkProxiesAction
      */
     private ArchivaConfiguration configuration;
 
-    private List networkProxies;
+    private List<NetworkProxyConfiguration> networkProxies;
 
     public void prepare()
         throws Exception
@@ -66,12 +67,12 @@ public class NetworkProxiesAction
         return bundle;
     }
 
-    public List getNetworkProxies()
+    public List<NetworkProxyConfiguration> getNetworkProxies()
     {
         return networkProxies;
     }
 
-    public void setNetworkProxies( List networkProxies )
+    public void setNetworkProxies( List<NetworkProxyConfiguration> networkProxies )
     {
         this.networkProxies = networkProxies;
     }
index 0db3422ec28c32b07540cd0ea24ad7ba80af3ae6..89aca8cf56fecb1013a677a7fa51f122b5f9144d 100644 (file)
@@ -33,11 +33,11 @@ import java.util.List;
 public class AddAdminRepoConsumerClosure
     implements Closure
 {
-    private List list = new ArrayList();
+    private List<AdminRepositoryConsumer> list = new ArrayList<AdminRepositoryConsumer>();
 
-    private List selectedIds;
+    private List<String> selectedIds;
 
-    public AddAdminRepoConsumerClosure( List selectedIds )
+    public AddAdminRepoConsumerClosure( List<String> selectedIds )
     {
         this.selectedIds = selectedIds;
     }
@@ -58,7 +58,7 @@ public class AddAdminRepoConsumerClosure
         }
     }
 
-    public List getList()
+    public List<AdminRepositoryConsumer> getList()
     {
         return list;
     }
index 3b4fd844bae0d89784859997f85df1f7318fbcc0..583e6d250c9e290b265ee815305bf7ba9776962b 100644 (file)
@@ -27,7 +27,7 @@ import java.util.Comparator;
  * @version $Id$
  */
 public class AdminRepositoryConsumerComparator
-    implements Comparator
+    implements Comparator<AdminRepositoryConsumer>
 {
     private static AdminRepositoryConsumerComparator INSTANCE = new AdminRepositoryConsumerComparator();
 
@@ -36,7 +36,7 @@ public class AdminRepositoryConsumerComparator
         return INSTANCE;
     }
 
-    public int compare( Object o1, Object o2 )
+    public int compare( AdminRepositoryConsumer o1, AdminRepositoryConsumer o2 )
     {
         if ( o1 == null && o2 == null )
         {
@@ -53,13 +53,8 @@ public class AdminRepositoryConsumerComparator
             return -1;
         }
 
-        if ( ( o1 instanceof AdminRepositoryConsumer ) && ( o2 instanceof AdminRepositoryConsumer ) )
-        {
-            String id1 = ( (AdminRepositoryConsumer) o1 ).getId();
-            String id2 = ( (AdminRepositoryConsumer) o2 ).getId();
-            return id1.compareToIgnoreCase( id2 );
-        }
-
-        return 0;
+        String id1 = o1.getId();
+        String id2 = o2.getId();
+        return id1.compareToIgnoreCase( id2 );
     }
 }
index 0d8086c1bc4c9e4a778c2364b593f09899d22431..599a23d0a845bfe05995490cf323b1ebb5cdaba3 100644 (file)
@@ -65,29 +65,29 @@ public class RepositoryScanningAction
      */
     private RepositoryContentConsumers repoconsumerUtil;
 
-    private Map fileTypeMap;
+    private Map<String, FileType> fileTypeMap;
 
-    private List fileTypeIds;
+    private List<String> fileTypeIds;
 
     /**
      * List of {@link AdminRepositoryConsumer} objects for consumers of known content.
      */
-    private List knownContentConsumers;
+    private List<AdminRepositoryConsumer> knownContentConsumers;
 
     /**
      * List of enabled {@link AdminRepositoryConsumer} objects for consumers of known content.
      */
-    private List enabledKnownContentConsumers;
+    private List<String> enabledKnownContentConsumers;
 
     /**
      * List of {@link AdminRepositoryConsumer} objects for consumers of invalid/unknown content.
      */
-    private List invalidContentConsumers;
+    private List<AdminRepositoryConsumer> invalidContentConsumers;
 
     /**
      * List of enabled {@link AdminRepositoryConsumer} objects for consumers of invalid/unknown content.
      */
-    private List enabledInvalidContentConsumers;
+    private List<String> enabledInvalidContentConsumers;
 
     private String pattern;
 
@@ -141,22 +141,22 @@ public class RepositoryScanningAction
         return fileTypeId;
     }
 
-    public List getFileTypeIds()
+    public List<String> getFileTypeIds()
     {
         return fileTypeIds;
     }
 
-    public Map getFileTypeMap()
+    public Map<String, FileType> getFileTypeMap()
     {
         return fileTypeMap;
     }
 
-    public List getInvalidContentConsumers()
+    public List<AdminRepositoryConsumer> getInvalidContentConsumers()
     {
         return invalidContentConsumers;
     }
 
-    public List getKnownContentConsumers()
+    public List<AdminRepositoryConsumer> getKnownContentConsumers()
     {
         return knownContentConsumers;
     }
@@ -200,7 +200,7 @@ public class RepositoryScanningAction
         this.invalidContentConsumers = addAdminRepoConsumer.getList();
         Collections.sort( invalidContentConsumers, AdminRepositoryConsumerComparator.getInstance() );
 
-        fileTypeIds = new ArrayList();
+        fileTypeIds = new ArrayList<String>();
         fileTypeIds.addAll( fileTypeMap.keySet() );
         Collections.sort( fileTypeIds );
     }
@@ -298,22 +298,22 @@ public class RepositoryScanningAction
         return SUCCESS;
     }
 
-    public List getEnabledInvalidContentConsumers()
+    public List<String> getEnabledInvalidContentConsumers()
     {
         return enabledInvalidContentConsumers;
     }
 
-    public void setEnabledInvalidContentConsumers( List enabledInvalidContentConsumers )
+    public void setEnabledInvalidContentConsumers( List<String> enabledInvalidContentConsumers )
     {
         this.enabledInvalidContentConsumers = enabledInvalidContentConsumers;
     }
 
-    public List getEnabledKnownContentConsumers()
+    public List<String> getEnabledKnownContentConsumers()
     {
         return enabledKnownContentConsumers;
     }
 
-    public void setEnabledKnownContentConsumers( List enabledKnownContentConsumers )
+    public void setEnabledKnownContentConsumers( List<String> enabledKnownContentConsumers )
     {
         this.enabledKnownContentConsumers = enabledKnownContentConsumers;
     }
index 55e8698fb0c81b52d40674817fbded4d0480f1f7..7f1d4d9758fa6992299cbf2249ebc255a5ce5505 100644 (file)
@@ -90,7 +90,7 @@ public class RepositoryActionMapper
             }
             else
             {
-                Map params = new HashMap();
+                Map<String, String> params = new HashMap<String, String>();
 
                 if ( path.charAt( 0 ) == '/' )
                 {
@@ -144,10 +144,11 @@ public class RepositoryActionMapper
         return super.getMapping( httpServletRequest, manager );
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public String getUriFromActionMapping( ActionMapping actionMapping )
     {
-        Map params = actionMapping.getParams();
+        Map<String, String> params = actionMapping.getParams();
         if ( ACTION_BROWSE.equals( actionMapping.getName() ) )
         {
             return BROWSE_PREFIX;
@@ -184,7 +185,7 @@ public class RepositoryActionMapper
         return super.getUriFromActionMapping( actionMapping );
     }
 
-    private String toUri( Map params, boolean artifactId, boolean version, String method )
+    private String toUri( Map<String, String> params, boolean artifactId, boolean version, String method )
     {
         StringBuffer buf = new StringBuffer();
 
index 7e16bea22fe485ce26e4843355f73b686715526e..091489761024e374fd2346faa045bf2107de9cc1 100644 (file)
@@ -39,7 +39,6 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.security.AccessDeniedException;
 import org.apache.maven.archiva.security.ArchivaSecurityException;
-import org.apache.maven.archiva.security.ArchivaXworkUser;
 import org.apache.maven.archiva.security.PrincipalNotFoundException;
 import org.apache.maven.archiva.security.ServletAuthenticator;
 import org.apache.maven.archiva.security.UserRepositories;
@@ -91,8 +90,6 @@ public class RssFeedServlet
 
     private HttpAuthenticator httpAuth;
     
-    private ArchivaXworkUser archivaXworkUser;
-
     public void init( javax.servlet.ServletConfig servletConfig )
         throws ServletException
     {
@@ -104,7 +101,6 @@ public class RssFeedServlet
             (ServletAuthenticator) wac.getBean( PlexusToSpringUtils.buildSpringId( ServletAuthenticator.class.getName() ) );
         httpAuth =
             (HttpAuthenticator) wac.getBean( PlexusToSpringUtils.buildSpringId( HttpAuthenticator.ROLE, "basic" ) );
-        archivaXworkUser = (ArchivaXworkUser) wac.getBean( PlexusToSpringUtils.buildSpringId( ArchivaXworkUser.class ) );
     }
 
     public void doGet( HttpServletRequest req, HttpServletResponse res )
index 4a3d1ba6e3b3c03c53febc9b8295408406c9e88c..5694e6ab7b5f19d6f398d2eb8398225ec635fbe8 100644 (file)
@@ -45,8 +45,8 @@ public class ArchivaStartup
         SecuritySynchronization securitySync = (SecuritySynchronization) wac.getBean(PlexusToSpringUtils.buildSpringId(SecuritySynchronization.class));
         ResolverFactoryInit resolverFactory = (ResolverFactoryInit) wac.getBean(PlexusToSpringUtils.buildSpringId(ResolverFactoryInit.class));
         ArchivaTaskScheduler taskScheduler = (ArchivaTaskScheduler) wac.getBean(PlexusToSpringUtils.buildSpringId(ArchivaTaskScheduler.class));
-        TaskQueueExecutor databaseUpdateQueue = (TaskQueueExecutor) wac.getBean(PlexusToSpringUtils.buildSpringId(TaskQueueExecutor.class, "database-update"));
-        TaskQueueExecutor repositoryScanningQueue = (TaskQueueExecutor) wac.getBean(PlexusToSpringUtils.buildSpringId(TaskQueueExecutor.class, "repository-scanning"));
+        wac.getBean(PlexusToSpringUtils.buildSpringId(TaskQueueExecutor.class, "database-update"));
+        wac.getBean(PlexusToSpringUtils.buildSpringId(TaskQueueExecutor.class, "repository-scanning"));
 
         try
         {
index 985bcb618a7d98e78e18714599daa4418b851268..e0daabea650ae74dd4cb6ac57d415897bc71fb63 100644 (file)
@@ -60,11 +60,12 @@ public class DependencyTreeTag
 
     private String artifactId;
 
+    @SuppressWarnings("unused")
     private String version;
 
     private String nodevar;
 
-    private Iterator treeIterator;
+    private Iterator<TreeEntry> treeIterator;
 
     private List<TreeEntry> tree;
 
@@ -104,6 +105,7 @@ public class DependencyTreeTag
         unExposeVariables();
     }
 
+    @SuppressWarnings("unchecked")
     public int doStartTag()
         throws JspException
     {
index ddc6d7bbede508e432064317ac6fd6d497195feb..8681fa6ba8900593579a55def98287d1bd140633 100644 (file)
@@ -19,16 +19,15 @@ package org.apache.maven.archiva.web.tags;
  * under the License.
  */
 
-import com.opensymphony.xwork2.util.ValueStack;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import org.apache.struts2.components.Component;
-import org.apache.struts2.views.jsp.TagUtils;
-
 import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.struts2.components.Component;
 import org.apache.struts2.views.jsp.ComponentTagSupport;
 
+import com.opensymphony.xwork2.util.ValueStack;
+
 /**
  * DownloadArtifactTag 
  *
index 7d9fdb86c374b9899a5e595c88874971fefc745d..8664313812d02fcb8c04c906025dbf1141bb996b 100644 (file)
@@ -116,6 +116,7 @@ public class GroupIdLink
         return determineActionURL( "browse", NAMESPACE, method, req, res, parameters, req.getScheme(), includeContext, encode, false, false );
     }
 
+    @SuppressWarnings("unchecked")
     private String determineBrowseGroupActionUrl( String gid )
     {
         parameters.put( "groupId", gid );
index 7fef4423af869997aaba7338bbf9c8dfe9d8571e..5b3062e90d0ed76d5e4b1df74c4dfdab0d394335 100644 (file)
@@ -33,7 +33,7 @@ import javax.servlet.jsp.PageContext;
  */
 public class PlexusTagUtil
 {
-    public static Object lookup( PageContext pageContext, Class clazz )
+    public static Object lookup( PageContext pageContext, Class<?> clazz )
         throws ComponentLookupException
     {
         return getContainer( pageContext ).lookup( clazz );
@@ -45,7 +45,7 @@ public class PlexusTagUtil
         return getContainer( pageContext ).lookup( role );
     }
 
-    public static Object lookup( PageContext pageContext, Class clazz, String hint )
+    public static Object lookup( PageContext pageContext, Class<?> clazz, String hint )
         throws ComponentLookupException
     {
         return getContainer( pageContext ).lookup( clazz, hint );
index 9bbc49522eabc81e2bd46ef9f011428056ac8c38..9579dbba080a2d678c94a11cc0033764ce3262ef 100644 (file)
@@ -34,11 +34,11 @@ import javax.servlet.jsp.PageContext;
  */
 public class ContextUtils
 {
-    private static final Map defaultSchemePortMap;
+    private static final Map<String, Integer> defaultSchemePortMap;
 
     static
     {
-        defaultSchemePortMap = new HashMap();
+        defaultSchemePortMap = new HashMap<String, Integer>();
         defaultSchemePortMap.put( "http", new Integer( 80 ) );
         defaultSchemePortMap.put( "https", new Integer( 443 ) );
     }
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java
deleted file mode 100644 (file)
index 07e4a70..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-package org.apache.maven.archiva.web.util;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.archiva.indexer.record.StandardArtifactIndexRecord;
-//import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
-//import org.apache.maven.model.Dependency;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-public class VersionMerger
-{
-
-    public static List /*<DependencyWrapper>*/ wrap( List /*<StandardArtifactIndexRecord>*/ artifacts )
-    {
-        List dependencies = new ArrayList();
-
-//        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
-//        {
-//            Dependency dependency = (Dependency) i.next();
-//
-//            dependencies.add( new DependencyWrapper( dependency ) );
-//        }
-
-        return dependencies;
-    }
-
-    public static Collection /*<DependencyWrapper*/ merge( Collection /*<StandardArtifactIndexRecord>*/ artifacts )
-    {
-        Map dependees = new LinkedHashMap();
-
-//        for ( Iterator i = artifacts.iterator(); i.hasNext(); )
-//        {
-//            StandardArtifactIndexRecord record = (StandardArtifactIndexRecord) i.next();
-//
-//            String key = record.getGroupId() + ":" + record.getArtifactId();
-//            if ( dependees.containsKey( key ) )
-//            {
-//                DependencyWrapper wrapper = (DependencyWrapper) dependees.get( key );
-//                wrapper.addVersion( record.getVersion() );
-//            }
-//            else
-//            {
-//                DependencyWrapper wrapper = new DependencyWrapper( record );
-//
-//                dependees.put( key, wrapper );
-//            }
-//        }
-
-        return dependees.values();
-    }
-
-//    public static class DependencyWrapper
-//    {
-//        private final String groupId;
-//
-//        private final String artifactId;
-//
-//        /**
-//         * Versions added. We ignore duplicates since you might add those with varying classifiers.
-//         */
-//        private Set versions = new HashSet();
-//
-//        private String version;
-//
-//        private String scope;
-//
-//        private String classifier;
-//
-//        public DependencyWrapper( StandardArtifactIndexRecord record )
-//        {
-//            this.groupId = record.getGroupId();
-//
-//            this.artifactId = record.getArtifactId();
-//
-//            addVersion( record.getVersion() );
-//        }
-//
-//        public DependencyWrapper( Dependency dependency )
-//        {
-//            this.groupId = dependency.getGroupId();
-//
-//            this.artifactId = dependency.getArtifactId();
-//
-//            this.scope = dependency.getScope();
-//
-//            this.classifier = dependency.getClassifier();
-//
-//            addVersion( dependency.getVersion() );
-//        }
-//
-//        public String getScope()
-//        {
-//            return scope;
-//        }
-//
-//        public String getClassifier()
-//        {
-//            return classifier;
-//        }
-//
-//        public void addVersion( String version )
-//        {
-//            // We use DefaultArtifactVersion to get the correct sorting order later, however it does not have
-//            // hashCode properly implemented, so we add it here.
-//            // TODO: add these methods to the actual DefaultArtifactVersion and use that.
-//            versions.add( new DefaultArtifactVersion( version )
-//            {
-//                public int hashCode()
-//                {
-//                    int result;
-//                    result = getBuildNumber();
-//                    result = 31 * result + getMajorVersion();
-//                    result = 31 * result + getMinorVersion();
-//                    result = 31 * result + getIncrementalVersion();
-//                    result = 31 * result + ( getQualifier() != null ? getQualifier().hashCode() : 0 );
-//                    return result;
-//                }
-//
-//                public boolean equals( Object o )
-//                {
-//                    if ( this == o )
-//                    {
-//                        return true;
-//                    }
-//                    if ( o == null || getClass() != o.getClass() )
-//                    {
-//                        return false;
-//                    }
-//
-//                    DefaultArtifactVersion that = (DefaultArtifactVersion) o;
-//
-//                    if ( getBuildNumber() != that.getBuildNumber() )
-//                    {
-//                        return false;
-//                    }
-//                    if ( getIncrementalVersion() != that.getIncrementalVersion() )
-//                    {
-//                        return false;
-//                    }
-//                    if ( getMajorVersion() != that.getMajorVersion() )
-//                    {
-//                        return false;
-//                    }
-//                    if ( getMinorVersion() != that.getMinorVersion() )
-//                    {
-//                        return false;
-//                    }
-//                    if ( getQualifier() != null ? !getQualifier().equals( that.getQualifier() )
-//                        : that.getQualifier() != null )
-//                    {
-//                        return false;
-//                    }
-//
-//                    return true;
-//                }
-//            } );
-//
-//            if ( versions.size() == 1 )
-//            {
-//                this.version = version;
-//            }
-//            else
-//            {
-//                this.version = null;
-//            }
-//        }
-//
-//        public String getGroupId()
-//        {
-//            return groupId;
-//        }
-//
-//        public String getArtifactId()
-//        {
-//            return artifactId;
-//        }
-//
-//        public List getVersions()
-//        {
-//            List versions = new ArrayList( this.versions );
-//            Collections.sort( versions );
-//            return versions;
-//        }
-//
-//        public String getVersion()
-//        {
-//            return version;
-//        }
-//    }
-}
index d8b19eacf285ef9034d43a8f075e0347e45510db..9d4eb3782535aed280b2d8a4eb687f43072d38f6 100644 (file)
@@ -73,6 +73,7 @@ public abstract class AbstractWebworkTestCase
      * 
      * NOTE: Don't forget to run {@link #preRequest(ActionSupport)} before each request to your action!
      */
+    @SuppressWarnings("unchecked")
     protected void assertNoErrors( ActionSupport action )
     {
         List<String> errors = (List<String>) action.getActionErrors();
@@ -91,6 +92,7 @@ public abstract class AbstractWebworkTestCase
         }
     }
 
+    @SuppressWarnings("unchecked")
     protected void assertRequestStatus( ActionSupport action, String expectedStatus, String methodName )
         throws Exception
     {
index cef9ccc960f4c3090b0b6b093f260761e7e85668..68296ed97103347b82298f7e358d7d2655966169 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.maven.archiva.web.action;
  */
 
 import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.Collections;
 import java.util.List;
 
 import org.apache.archiva.indexer.search.RepositorySearch;
@@ -153,7 +153,7 @@ public class SearchActionTest
         versions.add( "1.0" );
         versions.add( "1.1" );
         
-        archivaXworkUserControl.expectAndReturn( archivaXworkUser.getActivePrincipal( new HashMap() ), "user", 3 );
+        archivaXworkUserControl.expectAndReturn( getActivePrincipal(), "user", 3 );
                 
         userReposControl.expectAndReturn( userRepos.getObservableRepositoryIds( "user" ), selectedRepos, 2 );
         
@@ -177,6 +177,11 @@ public class SearchActionTest
         searchControl.verify();
         daoControl.verify();
     }
+
+    private String getActivePrincipal()
+    {
+        return archivaXworkUser.getActivePrincipal( Collections.<String,Object>emptyMap() );
+    }
     
     public void testSearchWithinSearchResults()
         throws Exception
@@ -213,7 +218,7 @@ public class SearchActionTest
         versions.add( "1.0" );
         versions.add( "1.1" );
         
-        archivaXworkUserControl.expectAndReturn( archivaXworkUser.getActivePrincipal( new HashMap() ), "user", 3 );
+        archivaXworkUserControl.expectAndReturn( getActivePrincipal(), "user", 3 );
                 
         userReposControl.expectAndReturn( userRepos.getObservableRepositoryIds( "user" ), selectedRepos, 2 );
         
@@ -247,7 +252,7 @@ public class SearchActionTest
         
         List<String> selectedRepos = new ArrayList<String>();
         
-        archivaXworkUserControl.expectAndReturn( archivaXworkUser.getActivePrincipal( new HashMap() ), "user" );
+        archivaXworkUserControl.expectAndReturn( getActivePrincipal(), "user" );
         
         userReposControl.expectAndReturn( userRepos.getObservableRepositoryIds( "user" ), selectedRepos );
         
@@ -279,7 +284,7 @@ public class SearchActionTest
                 
         SearchResults results = new SearchResults();
         
-        archivaXworkUserControl.expectAndReturn( archivaXworkUser.getActivePrincipal( new HashMap() ), "user", 2 );
+        archivaXworkUserControl.expectAndReturn( getActivePrincipal(), "user", 2 );
                 
         userReposControl.expectAndReturn( userRepos.getObservableRepositoryIds( "user" ), selectedRepos );
         
@@ -334,7 +339,7 @@ public class SearchActionTest
         
         SearchFields searchFields = new SearchFields( "org", null, null, null, null, selectedRepos );
         
-        archivaXworkUserControl.expectAndReturn( archivaXworkUser.getActivePrincipal( new HashMap() ), "user" );
+        archivaXworkUserControl.expectAndReturn( getActivePrincipal(), "user" );
         
         searchControl.expectAndReturn( search.search( "user", searchFields, limits ), results );
         
@@ -384,7 +389,7 @@ public class SearchActionTest
         
         SearchFields searchFields = new SearchFields( "org", null, null, null, null, selectedRepos );
         
-        archivaXworkUserControl.expectAndReturn( archivaXworkUser.getActivePrincipal( new HashMap() ), "user", 2 );
+        archivaXworkUserControl.expectAndReturn( getActivePrincipal(), "user", 2 );
         
         userReposControl.expectAndReturn( userRepos.getObservableRepositoryIds( "user" ), selectedRepos );
         
@@ -429,7 +434,7 @@ public class SearchActionTest
         
         SearchFields searchFields = new SearchFields( "org", null, null, null, null, selectedRepos );
         
-        archivaXworkUserControl.expectAndReturn( archivaXworkUser.getActivePrincipal( new HashMap() ), "user" );
+        archivaXworkUserControl.expectAndReturn( getActivePrincipal(), "user" );
         
         searchControl.expectAndReturn( search.search( "user", searchFields, limits ), results );
         
index 27772e51e4e31d164908b9ed1b0481140aafddcc..336f1097fd94cf5b63380cd20a7a297eb0e76bfe 100644 (file)
@@ -19,11 +19,9 @@ package org.apache.maven.archiva.web.action.admin.appearance;
  * under the License.
  */
 
-import com.opensymphony.xwork2.Action;
-import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.OrganisationInformation;
-import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.web.action.AbstractWebworkTestCase;
+
+import com.opensymphony.xwork2.Action;
 
 /**
  */
index 076f6c01e4357b62e68c2140f86e5aee76ae4c95..cc7d51889d31f500e596dd0b61702673389ed207 100644 (file)
@@ -117,6 +117,7 @@ public class AddProxyConnectorActionTest
         assertEquals( 1, connector.getProperties().size() );
     }
 
+    @SuppressWarnings("unchecked")
     public void testAddProxyConnectorCommit()
         throws Exception
     {
@@ -385,6 +386,7 @@ public class AddProxyConnectorActionTest
         archivaConfiguration.save( config );
     }
 
+    @SuppressWarnings("unchecked")
     private void populateProxyConnector( ProxyConnectorConfiguration connector )
     {
         connector.setProxyId( AbstractProxyConnectorFormAction.DIRECT_CONNECTION );
index 366f0643c49b318c58442f3cbe1d7f8d10aebbab..bfb5e915f41af05a1da1ddf6dd793350c0b998b5 100644 (file)
@@ -159,6 +159,7 @@ public class EditProxyConnectorActionTest
         assertEquals( 1, connector.getWhiteListPatterns().size() );
     }
 
+    @SuppressWarnings("unchecked")
     public void testEditProxyConnectorCommit()
         throws Exception
     {
@@ -375,6 +376,7 @@ public class EditProxyConnectorActionTest
         assertEquals( TEST_TARGET_ID, connector.getTargetRepoId() );
     }
 
+    @SuppressWarnings("unchecked")
     private Configuration createInitialConfiguration()
     {
         Configuration config = new Configuration();
index b3456aa36c9286c24c2e5c69faa804917f6b1f6e..0f17dd28cc1bb28efd6db564ccba4ed31a38e443 100644 (file)
@@ -28,6 +28,7 @@ import org.apache.maven.archiva.database.ProjectModelDAO;
 import org.apache.maven.archiva.database.RepositoryContentStatisticsDAO;
 import org.apache.maven.archiva.database.RepositoryProblemDAO;
 import org.apache.maven.archiva.database.SimpleConstraint;
+import org.apache.maven.archiva.model.RepositoryContentStatistics;
 
 /**
  * AbstractManagedRepositoryArchivaDAOStub
@@ -52,7 +53,7 @@ public class AbstractManagedRepositoryArchivaDAOStub
      */
     private RepositoryContentStatisticsDAO repoContentStatisticsDAO;
 
-    public List query( SimpleConstraint constraint )
+    public List<RepositoryContentStatistics> query( SimpleConstraint constraint )
     {
         return null;
     }
index 7141af57cf7f5e1e90e2df99f43331687925cd1d..7437342d89b804297e13a471144ff13cd26e33f0 100644 (file)
@@ -44,7 +44,7 @@ public class ArchivaDAOStub
 {
     private ArchivaConfiguration configuration;
 
-    public List query( SimpleConstraint constraint )
+    public List<RepositoryContentStatistics> query( SimpleConstraint constraint )
     {
         Assert.assertEquals( RepositoryContentStatistics.class, constraint.getResultClass() );
         
index 9b912692fddec11dafa65e557ecbdd467343c7d8..e18b2b5fff6451c0dd917bacbceea35f6c760573 100644 (file)
@@ -60,7 +60,7 @@ public class ProjectModelDAOStub
         return projectModel;
     }
 
-    public List queryProjectModels( Constraint constraint )
+    public List<ArchivaProjectModel> queryProjectModels( Constraint constraint )
         throws ObjectNotFoundException, ArchivaDatabaseException
     {
         // TODO Auto-generated method stub
index fbfd24e20db53e81d150387794347da10b5fc408..9825d2b116bf66987e3d0a85e7fc4a769a007ca7 100644 (file)
@@ -46,7 +46,7 @@ public class RepositoryContentStatisticsDAOStub
         Assert.assertEquals( "repo-ident", stats.getRepositoryId() );
     }
 
-    public List queryRepositoryContentStatistics( Constraint constraint )
+    public List<RepositoryContentStatistics> queryRepositoryContentStatistics( Constraint constraint )
         throws ObjectNotFoundException, ArchivaDatabaseException
     {
         Assert.assertTrue( constraint instanceof RepositoryContentStatisticsByRepositoryConstraint );
index 7a90f787807120e5ecbda09ac93e609ab9453737..c4ad7616f498e7980a26d0d03de61a3182fffe12 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.maven.archiva.web.action.admin.repositories;
  */
 
 import java.util.Collections;
+import java.util.List;
 
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
@@ -177,7 +178,7 @@ public class RepositoryGroupsActionTest
         assertNotNull( action.getGroupToRepositoryMap() );
         assertEquals( 1, action.getGroupToRepositoryMap().size() );
         
-        java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
+        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
         assertEquals( 1, repos.size() );
         assertEquals( REPO2_ID, repos.get( 0 ) );
     }
@@ -207,7 +208,7 @@ public class RepositoryGroupsActionTest
         assertNotNull( action.getGroupToRepositoryMap() );
         assertEquals( 1, action.getGroupToRepositoryMap().size() );
         
-        java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
+        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
         assertEquals( 1, repos.size() );
         assertEquals( REPO2_ID, repos.get( 0 ) );
         
@@ -256,7 +257,7 @@ public class RepositoryGroupsActionTest
         assertNotNull( action.getGroupToRepositoryMap() );
         assertEquals( 1, action.getGroupToRepositoryMap().size() );
         
-        java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
+        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
         assertEquals( 1, repos.size() );
         assertEquals( REPO2_ID, repos.get( 0 ) );
         
@@ -307,7 +308,7 @@ public class RepositoryGroupsActionTest
         assertNotNull( action.getGroupToRepositoryMap() );
         assertEquals( 1, action.getGroupToRepositoryMap().size() );
         
-        java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
+        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
         assertEquals( 1, repos.size() );
         assertEquals( REPO2_ID, repos.get( 0 ) );
         
@@ -343,7 +344,7 @@ public class RepositoryGroupsActionTest
         assertNotNull( action.getGroupToRepositoryMap() );
         assertEquals( 1, action.getGroupToRepositoryMap().size() );
         
-        java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
+        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
         assertEquals( 1, repos.size() );
         assertEquals( REPO2_ID, repos.get( 0 ) );
         
index c4ebafe9574bca574d2dcec3c336e3c9a3c641c7..3a4f66c840b215fc68e0cc49f648e29f1aab17db 100644 (file)
@@ -61,7 +61,7 @@ public class ArtifactDAOStub
         return null;
     }
 
-    public List queryArtifacts( Constraint constraint )
+    public List<ArchivaArtifact> queryArtifacts( Constraint constraint )
         throws ObjectNotFoundException, ArchivaDatabaseException
     {
         List<ArchivaArtifact> artifacts = new ArrayList<ArchivaArtifact>();
index e5068fdffd79568deea8f4c6cee2f46413cdea70..684fd4a67abb3db0748c767d7e61b5e1203c9fbc 100644 (file)
@@ -19,8 +19,6 @@ package org.apache.maven.archiva.web.rss;
  * under the License.
  */
 
-import java.io.IOException;
-
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.codec.Encoder;
@@ -113,7 +111,8 @@ public class RssFeedServletTest
 
         try
         {
-            WebResponse response = client.getResponse( "http://localhost/feeds?invalid_param=xxx" );
+            client.getResponse( "http://localhost/feeds?invalid_param=xxx" );
+            fail( "Expected exception" );
         }
         catch ( HttpException he )
         {
@@ -139,7 +138,8 @@ public class RssFeedServletTest
         
         try
         {
-            WebResponse response = client.getResponse( request );
+            client.getResponse( request );
+            fail( "Expected exception" );
         }
         catch ( HttpException he )
         {            
@@ -165,7 +165,8 @@ public class RssFeedServletTest
         
         try
         {
-            WebResponse response = client.getResponse( request );
+            client.getResponse( request );
+            fail( "Expected exception" );
         }
         catch ( HttpException he )
         {