]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1435] fix up useless boxing issues
authorBrett Porter <brett@apache.org>
Mon, 29 Nov 2010 00:39:43 +0000 (00:39 +0000)
committerBrett Porter <brett@apache.org>
Mon, 29 Nov 2010 00:39:43 +0000 (00:39 +0000)
Submitted by: Dave Brosius

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1039994 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverter.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacet.java
archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/RepositoryStatistics.java

index f1f16601b1d1681f497d02d907881bf8a08d20c6..707cbcbc65243b5b7d1f60cecaba5d91816af3cd 100644 (file)
@@ -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() ) )
                             {
index 7688ed689807e4475b086e1569b718f30ce1475b..b3f8e1cc76de8d2abaedd8083ddea5873227b71d 100644 (file)
@@ -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 )
index 5dbb2657e26917b447dde80dead2e9195953e85c..aa330385d991eb7a55526768fd203dbaaf99f719 100644 (file)
@@ -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 );
         }
     }
 }
index eab85f2970e266f91ae08550e7747215f46209b3..e4e1f83b6e3eeefcb3c394bc36c1f587e1e45905 100644 (file)
@@ -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<ProjectVersionReference> references = new ArrayList<ProjectVersionReference>();
         for ( int i = 0; i < numberOfRefs; i++ )
index 234357d37b4df57180a8e41cf2e031a30b6f5f65..9c288278d2d66a4a3238c228be1fe99386ab1dc9 100644 (file)
@@ -176,14 +176,14 @@ public class RepositoryStatistics
 
     public void fromProperties( Map<String, String> 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<String, String> entry : properties.entrySet() )
         {