[
https://issues.apache.org/jira/browse/LOG4J2-297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary Gregory resolved LOG4J2-297.
---------------------------------
Resolution: Fixed
Fix Version/s: 2.0-beta8
Assignee: Gary Gregory
Thank you for taking the time to provide a patch. I appreciate your
contribution.
{noformat}
commit -m "[LOG4J2-297] Wasted work in TestConfigurator.testEnvironment."
C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java
C:/vcs/svn/apache/log4j2/trunk/src/changes/changes.xml
Sending
C:/vcs/svn/apache/log4j2/trunk/core/src/test/java/org/apache/logging/log4j/core/config/TestConfigurator.java
Sending C:/vcs/svn/apache/log4j2/trunk/src/changes/changes.xml
Transmitting file data ...
Committed revision 1498782.
{noformat}
> Wasted work in TestConfigurator.testEnvironment
> -----------------------------------------------
>
> Key: LOG4J2-297
> URL: https://issues.apache.org/jira/browse/LOG4J2-297
> Project: Log4j 2
> Issue Type: Bug
> Affects Versions: 2.0-beta7
> Environment: any
> Reporter: Adrian Nistor
> Assignee: Gary Gregory
> Labels: patch, performance
> Fix For: 2.0-beta8
>
> Attachments: patch.diff
>
>
> The problem appears in Log4j 2.0-beta7 and in revision 1498014. I
> attached a one-line patch that fixes it.
> In method "TestConfigurator.testEnvironment", the loop over
> "map.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 meets
> some condition; however "map.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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]