You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Andy Gumbrecht (JIRA)" <ji...@apache.org> on 2014/12/02 12:29:12 UTC

[jira] [Created] (TOMEE-1465) org.apache.openejb.util.PropertyPlaceHolderHelper.PropertiesLookup caches properties

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)