Changeset 16267
- Timestamp:
- 21/07/08 14:30:45 (1 month ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/intermine/objectstore/main/src/org/intermine/util/TypeUtil.java
r16238 r16267 11 11 */ 12 12 13 import java.beans.Introspector;14 import java.beans.PropertyDescriptor;15 import java.beans.IntrospectionException;16 import java.lang.reflect.Method;17 import java.math.BigDecimal;18 import java.net.URL;19 import java.net.MalformedURLException;20 import java.util.List;21 13 import java.util.ArrayList; 22 import java.util.Iterator;23 14 import java.util.Arrays; 24 15 import java.util.Collection; … … 26 17 import java.util.HashMap; 27 18 import java.util.HashSet; 19 import java.util.Iterator; 20 import java.util.List; 28 21 import java.util.Map; 29 22 import java.util.Set; … … 31 24 import java.util.TimeZone; 32 25 import java.util.TreeMap; 33 import java.text.DateFormat;34 import java.text.ParseException;35 import java.text.SimpleDateFormat;36 26 37 27 import org.intermine.metadata.Model; 38 28 import org.intermine.model.InterMineObject; 39 29 import org.intermine.objectstore.proxy.ProxyReference; 30 31 import java.beans.IntrospectionException; 32 import java.beans.Introspector; 33 import java.beans.PropertyDescriptor; 34 import java.lang.reflect.Method; 35 import java.math.BigDecimal; 36 import java.net.MalformedURLException; 37 import java.net.URL; 38 import java.text.DateFormat; 39 import java.text.SimpleDateFormat; 40 40 41 41 /** … … 49 49 { 50 50 private TypeUtil() { 51 // empty 51 52 } 52 53 … … 535 536 try { 536 537 return DATE_TIME_FORMAT.parse(value); 537 } catch (ParseException e) { 538 } catch (Exception e) { 539 // probably ParseException, try a simpler format 538 540 try { 539 541 return DATE_FORMAT.parse(value); 540 } catch ( ParseException e1) {542 } catch (Exception e1) { 541 543 return new RuntimeException("Failed to parse " + value + " as a Date", e); 542 544 } 543 } catch (NumberFormatException e) {544 return new RuntimeException("Failed to parse " + value + " as a Date", e);545 545 } 546 546 }
