Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-2759

Static code analysis: potential lock collisions BaseTransactionManagerDelegate#findLock - interned string used as a lock

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 5.3.5.Final
    • 5.3.4.Final
    • JTS
    • None

      CID-17577: Bad choice of lock object - Potential lock collisions

      at class BaseTransactionManagerDelegate[9] at method findLock.

      string_literal: The string literal "__LOCKS_MAP" is an interned string.
        interned_string_lock: Locking on an interned string can cause unexpected locking collisions with third party code.
        Instead of using "__LOCKS_MAP" as a lock, create a final field of type Object which is only used as a lock.

      Explanation at description of JBTM-2758

      [9] https://github.com/jbosstm/narayana/blob/master/ArjunaJTS/integration/src/main/java/com/arjuna/ats/jbossatx/BaseTransactionManagerDelegate.java#L350

              ochaloup@redhat.com Ondrej Chaloupka (Inactive)
              ochaloup@redhat.com Ondrej Chaloupka (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: