JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
bug_report_small.png
CLOSED  Bug report JPPF-373  -  Properties substitutions not working in some cases in 4.2.x
Posted Feb 23, 2015 - updated Aug 15, 2018
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Bug report
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Progress
       
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Configuration
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Reproducability
    Always
  • Severity
    Normal
  • Targetted for
    icon_milestones.png JPPF 4.2.x
Issue description
In somes configuration cases, properties whose value hold multiple references to other properties are improperly resolved. This only happens in v4.2.x, since in the trunk (soon to be 5.0) the SubstitutionHandler class was completely rewritten.
Steps to reproduce this issue
Run the following test:
@Test
public void testSubstitutions2() throws Exception {
  StringBuilder sb = new StringBuilder();
  sb.append("prop.1 = one\n");
  sb.append("prop.2 = two\n");
  sb.append("prop.3 = three\n");
  sb.append("prop.4 = ${prop.1}-${prop.2}-${prop.3}-four\n");
  try (Reader r = new StringReader(sb.toString())) {
    TypedProperties props = ConfigurationHelper.loadAndResolve(r);
    assertTrue(props.containsKey("prop.4"));
    assertEquals("one-two-three-four", props.getProperty("prop.4"));
  }
}
==> the value of "prop.4" is resolved into "${prop.1}-two-three-four" instead of "one-two-three-four" and the test fails.

The same test works properly in the trunk.

#3
Comment posted by
 lolo4j
Feb 23, 01:10
fixed in branch b4.2 revision 3588