You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (Commented) (JIRA)" <ji...@apache.org> on 2011/11/26 02:02:46 UTC
[jira] [Commented] (LANG-774) Add isStarted isStopped and
isSuspended to StopWatch
[ https://issues.apache.org/jira/browse/LANG-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13157355#comment-13157355 ]
Sebb commented on LANG-774:
---------------------------
The patch contains a spurious (and incorrect) change to Validate.java, but that can be ignored.
Otherwise generally looks OK, though it might be better to use a positive check for isStarted.
i.e instead of
bq. return this.runningState != STATE_UNSTARTED && this.runningState != STATE_STOPPED;
one could use
return this.runningState == STATE_RUNNING || this.runningState == STATE_SUSPENDED;
It occurs to me that the code would be easier to read if the states were expressed as enums (the code predates them).
In which case, the enum itself could have methods for reporting whether it was started/stopped/etc.
> Add isStarted isStopped and isSuspended to StopWatch
> ----------------------------------------------------
>
> Key: LANG-774
> URL: https://issues.apache.org/jira/browse/LANG-774
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.time.*
> Affects Versions: 3.1
> Reporter: Michael Akerman
> Priority: Minor
> Labels: features
> Fix For: 3.2
>
> Attachments: LANG774.diff
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> It would be nice to have:
> isStarted
> isStopped
> isSuspended
> On StopWatch
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira