[ https://issues.apache.org/jira/browse/COLLECTIONS-374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13573750#comment-13573750 ]
Thomas Neidhart commented on COLLECTIONS-374: --------------------------------------------- The first test is not relevant anymore, as BeanMap has been removed. The second test checks symmetry of equals for the following scenario: {noformat} v1 = BoundedFifoBuffer v2 = TransformedBuffer(v1) v3 = UnmodifiableBuffer(v2) v2 == v3 && v3 == v2 {noformat} this fails because of AbstractCollectionDecorate#equals: {noformat} return object == this || decorated().equals(object); {noformat} now v3.equals(v2) evaluates to true, as v3.decorated() == v2 the other way round, v2.equals(v3) if false, as v2.decorated() == v1, and v1 does not implement equals, thus the default Object.equals() is used, which just compares references. > Bug in class#BeanMap and TransformedBuffer with reproducible JUnit test > ----------------------------------------------------------------------- > > Key: COLLECTIONS-374 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-374 > Project: Commons Collections > Issue Type: Bug > Affects Versions: 3.2 > Environment: jdk 1.6.0 > Reporter: Sai Zhang > Attachments: ApacheCommons_Documented_Test.java > > > Hi all: > (as in the previous post) > I am writing an automated bug finding tool, and using > Apache Commons Collections as an experimental subject > for evaluation. > The tool creates executable JUnit tests as well as > explanatory code comments. I attached one bug-revealing > test as follows. Could you please kindly check it, to > see if it is a real bug or not? > Also, it would be tremendous helpful if you could give > some feedback and suggestion on the generated code comments? > From the perspective of developers who are relatively familiar > with the code, > is the automatically-inferred comment useful in understanding > the generated test? is the comment helpful in bug fixing? > Your suggestion will help us improve the tool. > Please see attachment for the failed test. > The comment appears in the form of: > //Tests pass if .... (it gives some small change to the test which can make > the failed test pass) -- 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