Unsynchronized NameFactoryImpl initialization
---------------------------------------------
Key: JCR-1344
URL: https://issues.apache.org/jira/browse/JCR-1344
Project: Jackrabbit
Issue Type: Bug
Reporter: Thomas Mueller
Assignee: Thomas Mueller
Priority: Minor
org.apache.jackrabbit.spi.commons.name.NameFactoryImpl uses an unsafe pattern
when initializing:
private static NameFactory FACTORY;
private NameFactoryImpl() {};
public static NameFactory getInstance() {
if (FACTORY == null) {
FACTORY = new NameFactoryImpl();
}
return FACTORY;
}
This is bad in a multi-threaded environment (see
http://www.ibm.com/developerworks/library/j-dcl.html for details).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.