diff options
author | Olivier Lamy <olamy@apache.org> | 2014-03-25 06:27:50 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2014-03-25 06:27:50 +0000 |
commit | 91c9d36a7b5aabde1d614b88fa7c42a091e01a12 (patch) | |
tree | c1e13aa356fe6e7fee9acf5d8d29c32507009fed /archiva-modules/plugins/metadata-store-cassandra | |
parent | a7f93fed1095a51c94aff1888b8be0cb43e7ebe2 (diff) | |
download | archiva-91c9d36a7b5aabde1d614b88fa7c42a091e01a12.tar.gz archiva-91c9d36a7b5aabde1d614b88fa7c42a091e01a12.zip |
simplify code with adding constructors
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1581251 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins/metadata-store-cassandra')
-rw-r--r-- | archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java index 5a5747058..d7ba7b117 100644 --- a/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java +++ b/archiva-modules/plugins/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java @@ -65,7 +65,6 @@ import org.slf4j.LoggerFactory; import javax.persistence.PersistenceException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Date; @@ -981,10 +980,7 @@ public class CassandraMetadataRepository if ( StringUtils.isNotEmpty( ciSystem ) || StringUtils.isNotEmpty( ciUrl ) ) { - CiManagement ci = new CiManagement(); - ci.setSystem( ciSystem ); - ci.setUrl( ciUrl ); - projectVersionMetadata.setCiManagement( ci ); + projectVersionMetadata.setCiManagement( new CiManagement( ciSystem, ciUrl ) ); } } { @@ -992,10 +988,7 @@ public class CassandraMetadataRepository String issueSystem = columnFamilyResult.getString( "issueManagement.system" ); if ( StringUtils.isNotEmpty( issueSystem ) || StringUtils.isNotEmpty( issueUrl ) ) { - IssueManagement issueManagement = new IssueManagement(); - issueManagement.setSystem( issueSystem ); - issueManagement.setUrl( issueUrl ); - projectVersionMetadata.setIssueManagement( issueManagement ); + projectVersionMetadata.setIssueManagement( new IssueManagement( issueSystem, issueUrl ) ); } } { @@ -1003,23 +996,16 @@ public class CassandraMetadataRepository String organizationName = columnFamilyResult.getString( "organization.name" ); if ( StringUtils.isNotEmpty( organizationUrl ) || StringUtils.isNotEmpty( organizationName ) ) { - Organization organization = new Organization(); - organization.setName( organizationName ); - organization.setUrl( organizationUrl ); - projectVersionMetadata.setOrganization( organization ); + projectVersionMetadata.setOrganization( new Organization( organizationName, organizationUrl ) ); } } { String devConn = columnFamilyResult.getString( "scm.developerConnection" ); String conn = columnFamilyResult.getString( "scm.connection" ); String url = columnFamilyResult.getString( "scm.url" ); - if (StringUtils.isNotEmpty( devConn ) || StringUtils.isNotEmpty( conn ) || StringUtils.isNotEmpty( url )) + if ( StringUtils.isNotEmpty( devConn ) || StringUtils.isNotEmpty( conn ) || StringUtils.isNotEmpty( url ) ) { - Scm scm = new Scm(); - scm.setUrl( url ); - scm.setConnection( conn ); - scm.setDeveloperConnection( devConn ); - projectVersionMetadata.setScm( scm ); + projectVersionMetadata.setScm( new Scm( conn, devConn, url ) ); } } // FIXME complete collections !! |