tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Gumbrecht (JIRA)" <j...@apache.org>
Subject [jira] [Created] (TOMEE-1465) org.apache.openejb.util.PropertyPlaceHolderHelper.PropertiesLookup caches properties
Date Tue, 02 Dec 2014 11:29:12 GMT
Andy Gumbrecht created TOMEE-1465:
-------------------------------------

             Summary: org.apache.openejb.util.PropertyPlaceHolderHelper.PropertiesLookup caches
properties
                 Key: TOMEE-1465
                 URL: https://issues.apache.org/jira/browse/TOMEE-1465
             Project: TomEE
          Issue Type: Bug
    Affects Versions: 1.7.1, 2.0.0-Milestone-1
            Reporter: Andy Gumbrecht
            Assignee: Andy Gumbrecht
             Fix For: 2.0.0-Milestone-1, 1.7.2


org.apache.openejb.util.PropertyPlaceHolderHelper.PropertiesLookup should not cache SystemInstance.get().getProperties()
as this leads to race conditions and rare test failures where test order is not guaranteed.
The following illustrates the issue.

SystemInstance.get().setProperty("PropertyPlaceHolderTest1", "bob");
final String bob = PropertyPlaceHolderHelper.simpleValue("j${PropertyPlaceHolderTest1}");

SystemInstance.get().setProperty("PropertyPlaceHolderTest1", "sally");
final String sally = PropertyPlaceHolderHelper.simpleValue("j${PropertyPlaceHolderTest1}");

sally == "bob" <-- As PropertiesLookup is using cached properties from first call.

Calling PropertyPlaceHolderHelper .reset() on SystemInstance.get().setProperty() calls could
be an option, but would force a loader dep on core, or moving PropertyPlaceHolderHelper to
loader could be an option if it does not break anything.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message