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

Incorrect double-checked locking in com.sun.beans.introspect.ClassInfo

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 20
    • 11, 17, 18, 19, 20
    • client-libs
    • None

      There are 3 incorrect double-checked locking cases in ClassInfo:
          private List<Method> methods;
          private Map<String,PropertyInfo> properties;
          private Map<String,EventSetInfo> eventSets;

      For example:

          public List<Method> getMethods() {
              if (this.methods == null) {
                  synchronized (this.mutex) {
                      if (this.methods == null) {
                          this.methods = MethodInfo.get(this.type);
                      }
                  }
              }
              return this.methods;
          }

      'methods' is not volatile and read multiple times. This makes it an incorrect DCL.

            aturbanov Andrey Turbanov
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: