qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julien Lavigne du Cadet (JIRA)" <qpid-...@incubator.apache.org>
Subject [jira] Created: (QPID-1972) UUID.randomUUID() is not thread-safe
Date Mon, 06 Jul 2009 17:01:14 GMT
UUID.randomUUID() is not thread-safe
------------------------------------

                 Key: QPID-1972
                 URL: https://issues.apache.org/jira/browse/QPID-1972
             Project: Qpid
          Issue Type: Bug
          Components: Dot Net Client
    Affects Versions: 0.5
         Environment: .net API
            Reporter: Julien Lavigne du Cadet
            Priority: Critical


UUID.randomUUID is not thread-safe because it's using a static random object.
However, recreating a random object each time the method is called is not an option because
2 successive calls might result in the same UUID.

Please find attached in the next comment a patch that fixes the issue by introducing a UUIDGenerator
class. Now, to get a random UUID, you first need to instantiate a UUIDGenerator and request
it through it. That way there's no need to lock in the UUID class.

Please note that this patch is BREAKING COMPABILITY with previous versions of the API !

The patch is also fixing 2 others issues : 
- test.config is not included in the unit test project which result in half of the unit tests
failing 
- the management console is not compiling with vs 2008 and .Net 2.0



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


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message