osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] activemq-artemis pull request #2335: NO-JIRA Avoid possible double instantia...


Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2335#discussion_r220716297
  
    --- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java ---
    @@ -551,12 +551,16 @@ public CoreMessage setUserID(UUID userID) {
         */
        protected TypedProperties checkProperties() {
           if (properties == null) {
    -         TypedProperties properties = new TypedProperties();
    -         if (buffer != null && propertiesLocation >= 0) {
    -            final ByteBuf byteBuf = buffer.duplicate().readerIndex(propertiesLocation);
    -            properties.decode(byteBuf, coreMessageObjectPools == null ? null : coreMessageObjectPools.getPropertiesDecoderPools());
    +         synchronized (this) {
    --- End diff --
    
    Shouldn't the synchronized go *inside* the null check?


---