Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8150455

Reduce synchronization in DisabledAlgorithmConstraints

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Other
    • Icon: P4 P4
    • None
    • None
    • security-libs
    • None

      Some of the synchronization code in sun.security.util.DisabledAlgorithmConstraints seems to be unnecessary, in particular:

      1. The synchronized static Maps which map the security properties to the algorithms/constraints. DisabledAlgorithmConstraints, once created, is essentially immutable so each instance can be created for a specific property. Also, the callers who create these objects already cache them in static fields such that they are created once and re-used.

      2. The synchronization around the Map in KeySizeConstraints - this map is created in the constructor and never modified afterwards, so there is no need to synchronize access to it.

            ascarpino Anthony Scarpino
            mullan Sean Mullan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: