Log4j 2
  1. Log4j 2
  2. LOG4J2-298

Wasted work in StyleConverterTest.setupClass


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta7
    • Fix Version/s: 2.0-beta8
    • Component/s: None
    • Labels:
    • Environment:



      The problem appears in Log4j 2.0-beta7 and in revision 1498026. I
      attached a one-line patch (patch.diff) that fixes it.

      In method "StyleConverterTest.setupClass", the loop over
      "config.getAppenders().entrySet()" should break immediately after
      "app" is set the first time to "entry.getValue()". I don't think
      "app" is set a second time (and therefore all future iterations are
      not useful), but if it is, then there is a problem in the
      implementation: when the loop exits, "app" would be set to the last
      value of "entry.getValue()" that has "entry.getKey()" equal to "List";
      however "config.getAppenders().entrySet()" is a Set and therefore the
      order of iterating it is non-deterministic, i.e., the implementation
      should not rely on what the "last value" is.

      Methods "ThrowableTest.setupClass" and
      "ExtendedThrowableTest.setupClass" have similar problems. I attached
      similar patches (patch2.diff and patch3.diff respectively) for them.

      1. patch.diff
        0.6 kB
        Adrian Nistor
      2. patch2.diff
        0.6 kB
        Adrian Nistor
      3. patch3.diff
        0.6 kB
        Adrian Nistor


        Adrian Nistor created issue -
        Adrian Nistor made changes -
        Field Original Value New Value
        Attachment patch.diff [ 12590177 ]
        Attachment patch2.diff [ 12590178 ]
        Attachment patch3.diff [ 12590179 ]
        Gary Gregory added a comment -

        Done as of revision 1498780.

        Gary Gregory added a comment - Done as of revision 1498780.
        Gary Gregory made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Gary Gregory [ garydgregory ]
        Fix Version/s 2.0-beta8 [ 12324575 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        2d 7h 58m 1 Gary Gregory 02/Jul/13 06:09


          • Assignee:
            Gary Gregory
            Adrian Nistor
          • Votes:
            0 Vote for this issue
            2 Start watching this issue


            • Created: