You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Greg Brown (JIRA)" <ji...@apache.org> on 2010/07/22 15:40:50 UTC
[jira] Assigned: (PIVOT-577) Time.decode() throws NPE when no
milliseconds present in input string
[ https://issues.apache.org/jira/browse/PIVOT-577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Brown reassigned PIVOT-577:
--------------------------------
Assignee: Greg Brown (was: Sandro Martini)
> Time.decode() throws NPE when no milliseconds present in input string
> ---------------------------------------------------------------------
>
> Key: PIVOT-577
> URL: https://issues.apache.org/jira/browse/PIVOT-577
> Project: Pivot
> Issue Type: Bug
> Components: core-util
> Affects Versions: 1.5
> Environment: JDK 6 Update 21
> Reporter: Ilian Pavlov
> Assignee: Greg Brown
> Priority: Minor
> Fix For: 2.0
>
>
> Time.decode("12:34:56.789");
> works,
> Time.decode("12:34:56")
> throws a NullPointerException at org.apache.pivot.util.Time.decode(Time.java:399)
> I believe the problem is that matcher.groupCount() returns # of groups in pattern, not # of matched, so it always ==5; thus when no milliseconds passed, matcher.group(4) is null.
> if (matcher.groupCount() == 5) {
> millisecond = Integer.parseInt(matcher.group(4).substring(1));
> } else {
> millisecond = 0;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.