diff options
author | Olivier Lamy <olamy@apache.org> | 2013-05-19 22:28:52 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-05-19 22:28:52 +0000 |
commit | cfaf9559dd58f0b52ddd3bb906ff5f428c7e6486 (patch) | |
tree | 62d59228a3b1a70b2ede05f4aba77206c5b58f43 /archiva-modules/plugins | |
parent | 71dded175768d6949b2c4f9363049ffe52af320c (diff) | |
download | archiva-cfaf9559dd58f0b52ddd3bb906ff5f428c7e6486.tar.gz archiva-cfaf9559dd58f0b52ddd3bb906ff5f428c7e6486.zip |
use generics
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1484362 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins')
3 files changed, 9 insertions, 9 deletions
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java index ba4cc6952..251232738 100644 --- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java +++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java @@ -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, diff --git a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java index f0a3abc33..7bc605f67 100644 --- a/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java @@ -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" ); diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java index 764387ee7..9336a0fcc 100644 --- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java @@ -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 ) { |