maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/metadata SnapshotArtifactMetadata.java
Date Thu, 31 Mar 2005 11:31:12 GMT
brett       2005/03/31 03:31:12

  Modified:    maven-artifact/src/main/java/org/apache/maven/artifact/metadata
                        SnapshotArtifactMetadata.java
  Log:
  handle invalid format file
  
  Revision  Changes    Path
  1.11      +3 -3      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/SnapshotArtifactMetadata.java
  
  Index: SnapshotArtifactMetadata.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/metadata/SnapshotArtifactMetadata.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SnapshotArtifactMetadata.java	30 Mar 2005 05:34:50 -0000	1.10
  +++ SnapshotArtifactMetadata.java	31 Mar 2005 11:31:12 -0000	1.11
  @@ -169,14 +169,14 @@
           String version = FileUtils.fileRead( file );
           lastModified = file.lastModified();
   
  -        if ( version.indexOf( "SNAPSHOT" ) >= 0 )
  +        int index = version.lastIndexOf( "-" );
  +        if ( version.indexOf( "SNAPSHOT" ) >= 0 || index < 0 )
           {
               timestamp = null;
               buildNumber = 0;
               return;
           }
   
  -        int index = version.lastIndexOf( "-" );
           timestamp = version.substring( 0, index );
           buildNumber = Integer.valueOf( version.substring( index + 1 ) ).intValue();
           index = timestamp.lastIndexOf( "-" );
  
  
  

Mime
View raw message