]> source.dussan.org Git - archiva.git/commitdiff
use generics
authorOlivier Lamy <olamy@apache.org>
Sun, 19 May 2013 22:28:52 +0000 (22:28 +0000)
committerOlivier Lamy <olamy@apache.org>
Sun, 19 May 2013 22:28:52 +0000 (22:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1484362 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java

index 66838594bd81cb1a132d37e456eb65f5b0f540c7..2acbcb57c5ad88680dcd4da6e1ead23f2d72309a 100644 (file)
@@ -256,7 +256,7 @@ public class MockRepositorySessionFactory
                         return false;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public Object obtainAccess( Class<?> aClass )
+                    public <T>T obtainAccess( Class<T> aClass )
                     {
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
index d7c52cea3a5c8d021cbb99532969bc3ba42a2f8b..533951968c53005e95458caee590bd39e057dee3 100644 (file)
@@ -178,7 +178,7 @@ public class TestMetadataRepository
         return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
index c594a9e75bbc3dc5d65c980e67bce14bead7ab67..7be9d6cb7ca7b8eec881ea593967f8312589b005 100644 (file)
@@ -256,7 +256,7 @@ public class MockRepositorySessionFactory
                         return false;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public Object obtainAccess( Class<?> aClass )
+                    public <T>T obtainAccess( Class<T> aClass )
                     {
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
index a42b6aedad15a6fc42a3621ae067f8bece17e186..85c01299aba69b9c2161bbbe0093987f031f535c 100644 (file)
@@ -256,7 +256,7 @@ public class MockRepositorySessionFactory
                         return false;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public Object obtainAccess( Class<?> aClass )
+                    public <T>T obtainAccess( Class<T> aClass )
                     {
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
index b6f25bec574a0d5713519692670dd9419fdfcd91..a83f383019f117b557f880d28cfc8d25e09697e8 100644 (file)
@@ -250,7 +250,7 @@ public class NewArtifactsRssFeedProcessorTest
             return false;
         }
 
-        public Object obtainAccess( Class<?> aClass )
+        public <T>T obtainAccess( Class<T> aClass )
         {
             throw new UnsupportedOperationException();
         }
index 02d428515719726a32d22f2f492bd97f6f9f93fa..8f9fc13bdba2e7c07604f508f8a23893de8e2f5f 100644 (file)
@@ -220,7 +220,7 @@ public class TestMetadataRepository
         return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
         return null;
     }
index b07884a74b96bd7051f505aad9bc3625db4ba8ea..8fe7a6c2993f8af48b8ecca45ea9b9e8de042994 100644 (file)
@@ -174,7 +174,7 @@ public class TestMetadataRepository
         return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
         return null;
     }
index c9fe7570c9f49258552cc75392f39a8f1ae5aa69..f35a601e4d6963870167a91344316805c1ae8aad 100644 (file)
@@ -219,6 +219,6 @@ public interface MetadataRepository
 
     boolean canObtainAccess( Class<?> aClass );
 
-    Object obtainAccess( Class<?> aClass )
+    <T>T obtainAccess( Class<T> aClass )
         throws MetadataRepositoryException;
 }
index ba4cc69523e736ccbb0e6eb56540e8a98d17ca56..251232738357cfd156e69dff43c51da16a8ad573 100644 (file)
@@ -176,27 +176,27 @@ public class TestMetadataRepository
 
     public void save()
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        //
     }
 
     public void close()
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        //
     }
 
     public void revert()
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        //
     }
 
     public boolean canObtainAccess( Class<?> aClass )
     {
-        return false;  //To change body of implemented methods use File | Settings | File Templates.
+        return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
+        return null;
     }
 
     public void removeArtifact( String repositoryId, String namespace, String project, String version,
index f0a3abc335a7b2bc06096a9205c5929a0a0b8d18..7bc605f67850aa004fab23933a432142c1ef0b20 100644 (file)
@@ -559,7 +559,7 @@ public class FileMetadataRepository
         return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
         throw new IllegalArgumentException(
             "Access using " + aClass + " is not supported on the file metadata storage" );
index 764387ee717009ae81e0cc6b99101733c2990b51..9336a0fcc20c42105f097bfe088eabd985769321 100644 (file)
@@ -1256,14 +1256,14 @@ public class JcrMetadataRepository
         return aClass == Session.class;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
         throws MetadataRepositoryException
     {
         if ( aClass == Session.class )
         {
             try
             {
-                return getJcrSession();
+                return (T) getJcrSession();
             }
             catch ( RepositoryException e )
             {