From: Dave B. <bla...@us...> - 2013-09-26 23:23:59
|
Update of /cvsroot/sblim/jsr48-client/src/javax/cim In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv5652/src/javax/cim Modified Files: Tag: Experimental CIMDateTimeInterval.java CIMDateTimeAbsolute.java Log Message: 2674 Null pointer exception in CIMDateTime(String) Index: CIMDateTimeInterval.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/javax/cim/CIMDateTimeInterval.java,v retrieving revision 1.5.2.19 retrieving revision 1.5.2.20 diff -u -d -r1.5.2.19 -r1.5.2.20 --- CIMDateTimeInterval.java 7 Sep 2012 16:40:31 -0000 1.5.2.19 +++ CIMDateTimeInterval.java 26 Sep 2013 23:23:56 -0000 1.5.2.20 @@ -31,6 +31,7 @@ * 3026302 2010-07-07 blaschke-oss CIMDateTimeInterval uses # constructor instead of valueOf * 3400209 2011-08-31 blaschke-oss Highlighted Static Analysis (PMD) issues * 3565581 2012-09-07 blaschke-oss TCK: remove unnecessary overriding methods + * 2674 2013-09-26 blaschke-oss Null pointer exception in CIMDateTime(String) */ package javax.cim; @@ -194,6 +195,8 @@ * If string is not in the correct format. */ public CIMDateTimeInterval(String pIntervalString) throws IllegalArgumentException { + if (pIntervalString == null) throw new IllegalArgumentException( + "Null IntervalString is not allowed!"); if (pIntervalString.length() != LENGTH) throw new IllegalArgumentException("Length of " + pIntervalString + " must be " + LENGTH + ", " + pIntervalString.length() + " is not valid!"); Index: CIMDateTimeAbsolute.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/javax/cim/CIMDateTimeAbsolute.java,v retrieving revision 1.7.2.18 retrieving revision 1.7.2.19 diff -u -d -r1.7.2.18 -r1.7.2.19 --- CIMDateTimeAbsolute.java 7 Sep 2012 16:40:31 -0000 1.7.2.18 +++ CIMDateTimeAbsolute.java 26 Sep 2013 23:23:56 -0000 1.7.2.19 @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corp. 2006, 2012 + * (C) Copyright IBM Corp. 2006, 2013 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE @@ -27,6 +27,7 @@ * 3022501 2010-06-30 blaschke-oss Possible integer overflow in getTotalUSec * 3400209 2011-08-31 blaschke-oss Highlighted Static Analysis (PMD) issues * 3565581 2012-09-07 blaschke-oss TCK: remove unnecessary overriding methods + * 2674 2013-09-26 blaschke-oss Null pointer exception in CIMDateTime(String) */ package javax.cim; @@ -86,7 +87,7 @@ * If <code>Calendar</code> object is <code>null</code>. */ public CIMDateTimeAbsolute(Calendar pCalendar) throws IllegalArgumentException { - if (pCalendar == null) throw new IllegalArgumentException("null Calendar is not allowed!"); + if (pCalendar == null) throw new IllegalArgumentException("Null Calendar is not allowed!"); if (pCalendar.get(Calendar.YEAR) > 9999) throw new IllegalArgumentException( "The year field cannot be greater than 9999!"); set(pCalendar); @@ -101,6 +102,7 @@ * If string is not in the correct format. */ public CIMDateTimeAbsolute(String pDateTime) throws IllegalArgumentException { + if (pDateTime == null) throw new IllegalArgumentException("Null DateTime is not allowed!"); DTStringReader reader = new DTStringReader(pDateTime); this.iYear = reader.readAndCheck(4, "year", 0, 9999, true); this.iMonth = reader.readAndCheck(2, "month", 1, 12, true); |