Author: mkleint
Date: Sun Jan 13 10:51:43 2008
New Revision: 611624

URL: http://svn.apache.org/viewvc?rev=611624&view=rev
Log:
catch NumberFormatException which I was ocasionally getting in embedded use. 
Same behaviour as in ParseException -> ignore touchfile

Modified:
    
maven/artifact/trunk/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataTouchfile.java

Modified: 
maven/artifact/trunk/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataTouchfile.java
URL: 
http://svn.apache.org/viewvc/maven/artifact/trunk/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataTouchfile.java?rev=611624&r1=611623&r2=611624&view=diff
==============================================================================
--- 
maven/artifact/trunk/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataTouchfile.java
 (original)
+++ 
maven/artifact/trunk/src/main/java/org/apache/maven/artifact/repository/metadata/MetadataTouchfile.java
 Sun Jan 13 10:51:43 2008
@@ -1,5 +1,24 @@
 package org.apache.maven.artifact.repository.metadata;
 
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.codehaus.plexus.logging.Logger;
@@ -179,6 +198,11 @@
                         catch ( ParseException e )
                         {
                             logger.debug( "Cannot parse lastUpdated date: \'" 
+ rawVal + "\' using format: " + FORMAT.toLocalizedPattern() + ". Ignoring.", e 
);
+                            result = null;
+                        } 
+                        catch ( NumberFormatException e ) 
+                        {
+                            logger.debug( "Cannot parse lastUpdated date: \'" 
+ rawVal + "\' using format: " + FORMAT.toLocalizedPattern() + ". Touchfile: " 
+ touchfile.getAbsolutePath() + " Ignoring.", e );
                             result = null;
                         }
                     }


Reply via email to