From: Dave B. <bla...@us...> - 2013-10-11 10:13:14
|
Update of /cvsroot/sblim/jsr48-client/src/javax/cim In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13266/src/javax/cim Modified Files: CIMDateTimeAbsolute.java CIMDateTimeInterval.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.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- CIMDateTimeInterval.java 13 Sep 2012 09:29:24 -0000 1.24 +++ CIMDateTimeInterval.java 11 Oct 2013 10:13:10 -0000 1.25 @@ -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 @@ -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.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- CIMDateTimeAbsolute.java 13 Sep 2012 09:29:24 -0000 1.22 +++ CIMDateTimeAbsolute.java 11 Oct 2013 10:13:10 -0000 1.23 @@ -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); |