From 30f0ab23655781050fcf389919f078eb4e137eaa Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Mon, 29 Nov 2010 00:39:43 +0000 Subject: [PATCH] [MRM-1435] fix up useless boxing issues Submitted by: Dave Brosius git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1039994 13f79535-47bb-0310-9956-ffa450edef68 --- .../artifact/LegacyToDefaultConverter.java | 4 ++-- .../maven2/Maven2RepositoryPathTranslator.java | 2 +- .../storage/maven2/MavenArtifactFacet.java | 2 +- .../repository/file/FileMetadataRepository.java | 8 ++++---- .../repository/stats/RepositoryStatistics.java | 16 ++++++++-------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverter.java b/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverter.java index f1f16601b..707cbcbc6 100644 --- a/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverter.java +++ b/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverter.java @@ -145,7 +145,7 @@ public class LegacyToDefaultConverter if ( matcher.matches() ) { Snapshot snapshot = new Snapshot(); - snapshot.setBuildNumber( Integer.valueOf( matcher.group( 3 ) ).intValue() ); + snapshot.setBuildNumber( Integer.parseInt( matcher.group( 3 ) ) ); snapshot.setTimestamp( matcher.group( 2 ) ); versioning.setSnapshot( snapshot ); } @@ -520,7 +520,7 @@ public class LegacyToDefaultConverter if ( metadata.getVersioning() != null && metadata.getVersioning().getSnapshot() != null ) { Snapshot snapshot = metadata.getVersioning().getSnapshot(); - int build = Integer.valueOf( matcher.group( 3 ) ).intValue(); + int build = Integer.parseInt( matcher.group( 3 ) ); String ts = matcher.group( 2 ); if ( build == snapshot.getBuildNumber() && ts.equals( snapshot.getTimestamp() ) ) { diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java index 7688ed689..b3f8e1cc7 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java @@ -196,7 +196,7 @@ public class Maven2RepositoryPathTranslator String timestamp = m.group( 1 ); String buildNumber = m.group( 2 ); facet.setTimestamp( timestamp ); - facet.setBuildNumber( Integer.valueOf( buildNumber ) ); + facet.setBuildNumber( Integer.parseInt( buildNumber ) ); version = idSubStrFromVersion.substring( 0, mainVersionLength ) + timestamp + "-" + buildNumber; } catch ( IllegalStateException e ) diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacet.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacet.java index 5dbb2657e..aa330385d 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacet.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacet.java @@ -115,7 +115,7 @@ public class MavenArtifactFacet String buildNumber = properties.get( "buildNumber" ); if ( buildNumber != null ) { - this.buildNumber = Integer.valueOf( buildNumber ); + this.buildNumber = Integer.parseInt( buildNumber ); } } } diff --git a/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java b/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java index eab85f297..e4e1f83b6 100644 --- a/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java +++ b/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java @@ -255,7 +255,7 @@ public class FileMetadataRepository File directory = new File( getDirectory( repoId ), namespace + "/" + projectId + "/" + projectVersion ); Properties properties = readOrCreateProperties( directory, PROJECT_VERSION_METADATA_KEY ); - int i = Integer.valueOf( properties.getProperty( "ref:lastReferenceNum", "-1" ) ) + 1; + int i = Integer.parseInt( properties.getProperty( "ref:lastReferenceNum", "-1" ) ) + 1; setProperty( properties, "ref:lastReferenceNum", Integer.toString( i ) ); setProperty( properties, "ref:reference." + i + ".namespace", reference.getNamespace() ); setProperty( properties, "ref:reference." + i + ".projectId", reference.getProjectId() ); @@ -470,7 +470,7 @@ public class FileMetadataRepository String value = (String) entry.getValue(); if ( "updated".equals( field ) ) { - artifact.setFileLastModified( Long.valueOf( value ) ); + artifact.setFileLastModified( Long.parseLong( value ) ); } else if ( "size".equals( field ) ) { @@ -478,7 +478,7 @@ public class FileMetadataRepository } else if ( "whenGathered".equals( field ) ) { - artifact.setWhenGathered( new Date( Long.valueOf( value ) ) ); + artifact.setWhenGathered( new Date( Long.parseLong( value ) ) ); } else if ( "version".equals( field ) ) { @@ -937,7 +937,7 @@ public class FileMetadataRepository File directory = new File( getDirectory( repoId ), namespace + "/" + projectId + "/" + projectVersion ); Properties properties = readOrCreateProperties( directory, PROJECT_VERSION_METADATA_KEY ); - int numberOfRefs = Integer.valueOf( properties.getProperty( "ref:lastReferenceNum", "-1" ) ) + 1; + int numberOfRefs = Integer.parseInt( properties.getProperty( "ref:lastReferenceNum", "-1" ) ) + 1; List references = new ArrayList(); for ( int i = 0; i < numberOfRefs; i++ ) diff --git a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatistics.java b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatistics.java index 234357d37..9c288278d 100644 --- a/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatistics.java +++ b/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatistics.java @@ -176,14 +176,14 @@ public class RepositoryStatistics public void fromProperties( Map properties ) { - scanEndTime = new Date( Long.valueOf( properties.get( "scanEndTime" ) ) ); - scanStartTime = new Date( Long.valueOf( properties.get( "scanStartTime" ) ) ); - totalArtifactCount = Long.valueOf( properties.get( "totalArtifactCount" ) ); - totalArtifactFileSize = Long.valueOf( properties.get( "totalArtifactFileSize" ) ); - totalFileCount = Long.valueOf( properties.get( "totalFileCount" ) ); - totalGroupCount = Long.valueOf( properties.get( "totalGroupCount" ) ); - totalProjectCount = Long.valueOf( properties.get( "totalProjectCount" ) ); - newFileCount = Long.valueOf( properties.get( "newFileCount" ) ); + scanEndTime = new Date( Long.parseLong( properties.get( "scanEndTime" ) ) ); + scanStartTime = new Date( Long.parseLong( properties.get( "scanStartTime" ) ) ); + totalArtifactCount = Long.parseLong( properties.get( "totalArtifactCount" ) ); + totalArtifactFileSize = Long.parseLong( properties.get( "totalArtifactFileSize" ) ); + totalFileCount = Long.parseLong( properties.get( "totalFileCount" ) ); + totalGroupCount = Long.parseLong( properties.get( "totalGroupCount" ) ); + totalProjectCount = Long.parseLong( properties.get( "totalProjectCount" ) ); + newFileCount = Long.parseLong( properties.get( "newFileCount" ) ); totalCountForType.clear(); for ( Map.Entry entry : properties.entrySet() ) { -- 2.39.5