activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <>
Subject [jira] Resolved: (AMQCPP-125) Decaf: Random
Date Mon, 11 Jun 2007 11:49:33 GMT


Timothy Bish resolved AMQCPP-125.

       Resolution: Fixed
    Fix Version/s: 2.1
         Assignee: Timothy Bish  (was: Nathan Mittler)

Applied patches to bot trunk and decaf builds and tests pass in both

> Decaf: Random
> -------------
>                 Key: AMQCPP-125
>                 URL:
>             Project: ActiveMQ C++ Client
>          Issue Type: New Feature
>    Affects Versions: 2.2
>            Reporter: Albert Strasheim
>            Assignee: Timothy Bish
>            Priority: Minor
>             Fix For: 2.1
>         Attachments: Randomv1.diff
> Attached is a patch that implements a Random class that works the same as java.util.Random.
This code can probably go into Decaf. The patch puts it in activemq/util for now.
> I adapted the code from Harmony's implementation of Random:
> I couldn't find a test for java.util.Random in the Harmony sources (just took a quick
look), so I used the values from the Mauve test:
> The Mauve tests are licensed under the GPL. Does using a few values from this test cause
problems as far as licensing of this new code goes? Hopefully not.
> The port to C++ was more or less straightforward. There were three main issues:
> 1. C++ doesn't have >>>. If I understand >>> correctly, in C++ it's
equivalent to doing >> on an unsigned type.
> 2. You can't shift more than 31 places at a time in a portable manner. This is because
at least the Intel shift instructions only look at the bottom 5 bits of the register that
tells it how far to shift. As far as I know, the easiest solution is just to shift multiple
> 3. Some java.util.Random methods are synchronized. I haven't included this functionality
in the first version of the patch. It should be easy to add.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message