You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Henri Yandell (JIRA)" <ji...@apache.org> on 2010/03/20 21:18:27 UTC

[jira] Closed: (LANG-606) EqualsBuilder causes StackOverflowException

     [ https://issues.apache.org/jira/browse/LANG-606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell closed LANG-606.
------------------------------

    Resolution: Fixed

Thanks Oliver.

I modified the @since tags, but otherwise committed as is.

svn ci -m "Applying the copy of the HashCodeBuilder code to stop cyclic references over to EqualsBuilder per LANG-606 and Oliver Sauder's patch" src/
Sending        src/main/java/org/apache/commons/lang3/builder/EqualsBuilder.java
Sending        src/test/java/org/apache/commons/lang3/builder/EqualsBuilderTest.java
Transmitting file data ..
Committed revision 925671.


> EqualsBuilder causes StackOverflowException
> -------------------------------------------
>
>                 Key: LANG-606
>                 URL: https://issues.apache.org/jira/browse/LANG-606
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.builder.*
>    Affects Versions: 2.5
>            Reporter: Oliver Sauder
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: EqualsBuilderCyclicalObjectReferences-v01.patch, EqualsBuilderCyclicalObjectReferences.patch
>
>
> EqualsBuilder causes StackOverflowException when comparing objects with cyclical object references.
> e,g.
> static class TestObjectReference {
> 		@SuppressWarnings("unused")
> 		private TestObjectReference reference;
>     	@SuppressWarnings("unused")
> 		private TestObject one;
>     	
>     	public TestObjectReference(int one) {
> 			this.one = new TestObject(one);
> 		}
>     	
>     	public void setObjectReference(
>     			TestObjectReference reference) {
> 			this.reference = reference;
> 		}
> 		@Override
> 		public boolean equals(Object obj) {
> 			return EqualsBuilder.reflectionEquals(this, obj);
> 		}
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.