User Name: David J. Miller
Email: ###@###.###
Platform: Solaris SPARC
JWS Version: Java WorkShop 2.0 Pre-Beta
Java Version: JDK1.1.1/jws:05/05/97
Serial Number: JWS100-DAASSU-912858473
I just downloaded build 93 and there appears to be a new bug in the
SimpleDateFormat class' parse/subParse methods.
I get a Null Pointer exception whenever I pass
in a time string containing two zeros (00) in at least one of the time
fields. If I replace the 00 with something else like 01, then it works.
This problem did not exist in my previous version of Workshop.
Here is a sample of the code, followed by the exception messages:
private SimpleDateFormat timeFormatter;
timeFormatter = new SimpleDateFormat("HH:mm:ss");
timeFormatter.setLenient(false);
public boolean correctTimeFormat(String timestring)
{
try
{
System.err.println(timestring);
Date date = timeFormatter.parse(timestring);
return true;
}
catch (ParseException parsee)
{
return false;
}
}
10:03:07
13:45:01
13:50:00
java.lang.NullPointerException
at java.text.SimpleDateFormat.subParse(Compiled Code)
at java.text.SimpleDateFormat.parse(Compiled Code)
at java.text.DateFormat.parse(Compiled Code)
at CPSupport.CPExecutionState.correctTimeFormat(Compiled Code)
at Schedule.CPScheduleHandler.processHeaderDirectiveArgs(Compiled Code)
at Schedule.CPScheduleHandler.processBeginops(Compiled Code)
at Schedule.CPScheduleHandler.processDirective(Compiled Code)
at Schedule.CPScheduleHandler.processSchedule(Compiled Code)
at Schedule.CPScheduleHandler.<init>(Compiled Code)
at CPThread.run(Compiled Code)
****
This is reproducable.
sfoster@eng 1997-05-29
Email: ###@###.###
Platform: Solaris SPARC
JWS Version: Java WorkShop 2.0 Pre-Beta
Java Version: JDK1.1.1/jws:05/05/97
Serial Number: JWS100-DAASSU-912858473
I just downloaded build 93 and there appears to be a new bug in the
SimpleDateFormat class' parse/subParse methods.
I get a Null Pointer exception whenever I pass
in a time string containing two zeros (00) in at least one of the time
fields. If I replace the 00 with something else like 01, then it works.
This problem did not exist in my previous version of Workshop.
Here is a sample of the code, followed by the exception messages:
private SimpleDateFormat timeFormatter;
timeFormatter = new SimpleDateFormat("HH:mm:ss");
timeFormatter.setLenient(false);
public boolean correctTimeFormat(String timestring)
{
try
{
System.err.println(timestring);
Date date = timeFormatter.parse(timestring);
return true;
}
catch (ParseException parsee)
{
return false;
}
}
10:03:07
13:45:01
13:50:00
java.lang.NullPointerException
at java.text.SimpleDateFormat.subParse(Compiled Code)
at java.text.SimpleDateFormat.parse(Compiled Code)
at java.text.DateFormat.parse(Compiled Code)
at CPSupport.CPExecutionState.correctTimeFormat(Compiled Code)
at Schedule.CPScheduleHandler.processHeaderDirectiveArgs(Compiled Code)
at Schedule.CPScheduleHandler.processBeginops(Compiled Code)
at Schedule.CPScheduleHandler.processDirective(Compiled Code)
at Schedule.CPScheduleHandler.processSchedule(Compiled Code)
at Schedule.CPScheduleHandler.<init>(Compiled Code)
at CPThread.run(Compiled Code)
****
This is reproducable.
sfoster@eng 1997-05-29
- duplicates
-
JDK-4048975 NumberFormat parse throws exceptions on 0
-
- Closed
-