Stephan Siano created ARIES-1113:
------------------------------------

             Summary: Double checked locking in BundleRevisionResource
                 Key: ARIES-1113
                 URL: https://issues.apache.org/jira/browse/ARIES-1113
             Project: Aries
          Issue Type: Bug
          Components: Subsystem
            Reporter: Stephan Siano


The class org.apache.aries.subsystem.core.internal.BundleRevisionResource 
contains the following method:

private ParsedServiceElements getParsedServiceElements() {
  ParsedServiceElements result = elements;
  if (result == null) {
    synchronized (this) {
      result = elements;
      if (result == null)
        elements = result = computeParsedServiceElements();
    }
  }
  return result;
}

It is well known that this double checked locking ideom does not work. It 
should be changed to something like

private synchronized ParsedServiceElements getParsedServiceElements() {
  if (elements == null)
    elements = computeParsedServiceElements();
  return elements;
}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to