You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Norman Maurer (Resolved) (JIRA)" <ji...@apache.org> on 2011/10/05 15:34:35 UTC

[jira] [Resolved] (MAILBOX-149) Generated MailboxSession id may be 0L

     [ https://issues.apache.org/jira/browse/MAILBOX-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Norman Maurer resolved MAILBOX-149.
-----------------------------------

    Resolution: Fixed

done
                
> Generated MailboxSession id may be 0L
> -------------------------------------
>
>                 Key: MAILBOX-149
>                 URL: https://issues.apache.org/jira/browse/MAILBOX-149
>             Project: James Mailbox
>          Issue Type: Bug
>          Components: store
>    Affects Versions: 0.3
>            Reporter: Norman Maurer
>            Assignee: Norman Maurer
>            Priority: Minor
>             Fix For: 0.4
>
>
> Every MailboxSession has an id which is in fact a long. The Id should be unique during until the jvm was restarted (or at least unique enough that active mailboxsessions don't have the same id). We generate this id by using Random.nextLong() which fullfill our needs. The only problem is that Random.nextLong() may return 0L if we are lucky enough. This is a problem as we use 0L as id for MailboxSessions which where create by the "system". So 0L serve a special purpose. 
> So we need to make sure that 0L will never get returned for a generated MailboxSession id.

--
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org