Author: hibou
Date: Mon Dec 20 10:51:13 2010
New Revision: 1051051
URL: http://svn.apache.org/viewvc?rev=1051051&view=rev
Log:
avoid printing a warning when there is no timestamp in the obr.xml
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
Modified:
ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java?rev=1051051&r1=1051050&r2=1051051&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/obr/xml/OBRXMLParser.java
Mon Dec 20 10:51:13 2010
@@ -110,11 +110,13 @@ public class OBRXMLParser {
repo.setName(atts.getValue(REPOSITORY_NAME));
String lastModified = atts.getValue(REPOSITORY_LASTMODIFIED);
- try {
- repo.setLastModified(Long.valueOf(lastModified));
- } catch (NumberFormatException e) {
- printWarning(this, "Incorrect last modified timestamp : " +
lastModified
- + ". It will be ignored.");
+ if (lastModified != null) {
+ try {
+ repo.setLastModified(Long.valueOf(lastModified));
+ } catch (NumberFormatException e) {
+ printWarning(this, "Incorrect last modified timestamp : "
+ lastModified
+ + ". It will be ignored.");
+ }
}
}