[
https://issues.apache.org/jira/browse/ARIES-1113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephan Siano closed ARIES-1113.
--------------------------------
Resolution: Not A Problem
I overlooked that elements is volatile, so this does work. My mistake.
> 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:
> {code}
> private ParsedServiceElements getParsedServiceElements() {
> ParsedServiceElements result = elements;
> if (result == null) {
> synchronized (this) {
> result = elements;
> if (result == null)
> elements = result = computeParsedServiceElements();
> }
> }
> return result;
> }
> {code}
> It is well known that this double checked locking ideom does not work. It
> should be changed to something like
> {code}
> private synchronized ParsedServiceElements getParsedServiceElements() {
> if (elements == null)
> elements = computeParsedServiceElements();
> return elements;
> }
> {code}
--
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