[jira] [Updated] (LANG-456) HashCodeBuilder throws StackOverflowError in bidirectional navigable association
[ https://issues.apache.org/jira/browse/LANG-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pascal Schumacher updated LANG-456: --- Fix Version/s: (was: 3.5) > HashCodeBuilder throws StackOverflowError in bidirectional navigable > association > > > Key: LANG-456 > URL: https://issues.apache.org/jira/browse/LANG-456 > Project: Commons Lang > Issue Type: Bug > Components: lang.builder.* >Affects Versions: 2.4 > Environment: Widows XP. Sun JDK 1.5 or 1.6. >Reporter: Bob Fields > Attachments: > 0001-LANG-456-HashCodeBuilder-throws-StackOverflowError-i.patch, > HashCodeBuilderStackOverflow.zip, LANG-456-patch.txt, StackOverflowError.zip > > > This is not the reflection methods, it is the regular HashCodeBuilder append > methods. It causes EqualsBuilder, ToStringBuilder, CompareToBuilder to also > throw the StackOverflowException, but those methods work when one of the > HashCodeBuilder bidirectional association attributes .hashCode() is commented > out. The problem is that all of the builders call registerObject() which > creates a hashCode, but only the reflectionAppend method checks if an object > is registered. > Bi-directional associations are a very common pattern in Jaxb and Hibernate. > In this case, I generate code from a model in order to avoid the reflection > penalty - I already know what the attributes are at compile time, so I use > .append instead of .reflectionAppend. > See attached example + unit test. One side of the bidirectional association > must be commented out in the hashCode method. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (LANG-456) HashCodeBuilder throws StackOverflowError in bidirectional navigable association
[ https://issues.apache.org/jira/browse/LANG-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bruno P. Kinoshita updated LANG-456: Attachment: 0001-LANG-456-HashCodeBuilder-throws-StackOverflowError-i.patch Applying the patch to my project today resulted in errors both via command line and using Eclipse (guess it's something with my `patch -p0 -i ...` command?). Using Eclipse, however, let me at least copy the test without the + prefix. After importing the tests from the patch, the bug was reproducible via a new test method. Later I imported the part of the code that fixes the issue, and it worked like a charm. +1 to applying the Woonsan's patch HashCodeBuilder throws StackOverflowError in bidirectional navigable association Key: LANG-456 URL: https://issues.apache.org/jira/browse/LANG-456 Project: Commons Lang Issue Type: Bug Components: lang.builder.* Affects Versions: 2.4 Environment: Widows XP. Sun JDK 1.5 or 1.6. Reporter: Bob Fields Fix For: Review Patch Attachments: 0001-LANG-456-HashCodeBuilder-throws-StackOverflowError-i.patch, HashCodeBuilderStackOverflow.zip, LANG-456-patch.txt, StackOverflowError.zip This is not the reflection methods, it is the regular HashCodeBuilder append methods. It causes EqualsBuilder, ToStringBuilder, CompareToBuilder to also throw the StackOverflowException, but those methods work when one of the HashCodeBuilder bidirectional association attributes .hashCode() is commented out. The problem is that all of the builders call registerObject() which creates a hashCode, but only the reflectionAppend method checks if an object is registered. Bi-directional associations are a very common pattern in Jaxb and Hibernate. In this case, I generate code from a model in order to avoid the reflection penalty - I already know what the attributes are at compile time, so I use .append instead of .reflectionAppend. See attached example + unit test. One side of the bidirectional association must be commented out in the hashCode method. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (LANG-456) HashCodeBuilder throws StackOverflowError in bidirectional navigable association
[ https://issues.apache.org/jira/browse/LANG-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Woonsan Ko updated LANG-456: Attachment: LANG-456-patch.txt Attaching my patch (LANG-456-patch.txt) to fix this issue. I moved the isRegistered()-register()-unregister() code from #reflectionAppend() to #append(). I think this should be more reasonable because #reflectionAppend() invokes #append() method anyway. Also, #append(Object) code has been improved to check registration status only when the object argument is neither primitive nor String type. Please take a review. Cheers, Woonsan HashCodeBuilder throws StackOverflowError in bidirectional navigable association Key: LANG-456 URL: https://issues.apache.org/jira/browse/LANG-456 Project: Commons Lang Issue Type: Bug Components: lang.builder.* Affects Versions: 2.4 Environment: Widows XP. Sun JDK 1.5 or 1.6. Reporter: Bob Fields Fix For: Patch Needed Attachments: HashCodeBuilderStackOverflow.zip, LANG-456-patch.txt, StackOverflowError.zip This is not the reflection methods, it is the regular HashCodeBuilder append methods. It causes EqualsBuilder, ToStringBuilder, CompareToBuilder to also throw the StackOverflowException, but those methods work when one of the HashCodeBuilder bidirectional association attributes .hashCode() is commented out. The problem is that all of the builders call registerObject() which creates a hashCode, but only the reflectionAppend method checks if an object is registered. Bi-directional associations are a very common pattern in Jaxb and Hibernate. In this case, I generate code from a model in order to avoid the reflection penalty - I already know what the attributes are at compile time, so I use .append instead of .reflectionAppend. See attached example + unit test. One side of the bidirectional association must be commented out in the hashCode method. -- This message was sent by Atlassian JIRA (v6.1#6144)
[jira] [Updated] (LANG-456) HashCodeBuilder throws StackOverflowError in bidirectional navigable association
[ https://issues.apache.org/jira/browse/LANG-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated LANG-456: --- Fix Version/s: (was: Patch Needed) Review Patch HashCodeBuilder throws StackOverflowError in bidirectional navigable association Key: LANG-456 URL: https://issues.apache.org/jira/browse/LANG-456 Project: Commons Lang Issue Type: Bug Components: lang.builder.* Affects Versions: 2.4 Environment: Widows XP. Sun JDK 1.5 or 1.6. Reporter: Bob Fields Fix For: Review Patch Attachments: HashCodeBuilderStackOverflow.zip, LANG-456-patch.txt, StackOverflowError.zip This is not the reflection methods, it is the regular HashCodeBuilder append methods. It causes EqualsBuilder, ToStringBuilder, CompareToBuilder to also throw the StackOverflowException, but those methods work when one of the HashCodeBuilder bidirectional association attributes .hashCode() is commented out. The problem is that all of the builders call registerObject() which creates a hashCode, but only the reflectionAppend method checks if an object is registered. Bi-directional associations are a very common pattern in Jaxb and Hibernate. In this case, I generate code from a model in order to avoid the reflection penalty - I already know what the attributes are at compile time, so I use .append instead of .reflectionAppend. See attached example + unit test. One side of the bidirectional association must be commented out in the hashCode method. -- This message was sent by Atlassian JIRA (v6.1#6144)
[jira] [Updated] (LANG-456) HashCodeBuilder throws StackOverflowError in bidirectional navigable association
[ https://issues.apache.org/jira/browse/LANG-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated LANG-456: --- Fix Version/s: (was: 3.x) Patch Needed HashCodeBuilder throws StackOverflowError in bidirectional navigable association Key: LANG-456 URL: https://issues.apache.org/jira/browse/LANG-456 Project: Commons Lang Issue Type: Bug Components: lang.builder.* Affects Versions: 2.4 Environment: Widows XP. Sun JDK 1.5 or 1.6. Reporter: Bob Fields Fix For: Patch Needed Attachments: HashCodeBuilderStackOverflow.zip, StackOverflowError.zip This is not the reflection methods, it is the regular HashCodeBuilder append methods. It causes EqualsBuilder, ToStringBuilder, CompareToBuilder to also throw the StackOverflowException, but those methods work when one of the HashCodeBuilder bidirectional association attributes .hashCode() is commented out. The problem is that all of the builders call registerObject() which creates a hashCode, but only the reflectionAppend method checks if an object is registered. Bi-directional associations are a very common pattern in Jaxb and Hibernate. In this case, I generate code from a model in order to avoid the reflection penalty - I already know what the attributes are at compile time, so I use .append instead of .reflectionAppend. See attached example + unit test. One side of the bidirectional association must be commented out in the hashCode method. -- This message was sent by Atlassian JIRA (v6.1#6144)
[jira] Updated: (LANG-456) HashCodeBuilder throws StackOverflowError in bidirectional navigable association
[ https://issues.apache.org/jira/browse/LANG-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated LANG-456: --- Fix Version/s: (was: 3.0) 3.1 Moving to 3.1; there's no patch and I don't think a fix would be backwards incompatible [i.e. doesn't have to be done in 3.0]. HashCodeBuilder throws StackOverflowError in bidirectional navigable association Key: LANG-456 URL: https://issues.apache.org/jira/browse/LANG-456 Project: Commons Lang Issue Type: Bug Components: lang.builder.* Affects Versions: 2.4 Environment: Widows XP. Sun JDK 1.5 or 1.6. Reporter: Bob Fields Fix For: 3.1 Attachments: HashCodeBuilderStackOverflow.zip, StackOverflowError.zip This is not the reflection methods, it is the regular HashCodeBuilder append methods. It causes EqualsBuilder, ToStringBuilder, CompareToBuilder to also throw the StackOverflowException, but those methods work when one of the HashCodeBuilder bidirectional association attributes .hashCode() is commented out. The problem is that all of the builders call registerObject() which creates a hashCode, but only the reflectionAppend method checks if an object is registered. Bi-directional associations are a very common pattern in Jaxb and Hibernate. In this case, I generate code from a model in order to avoid the reflection penalty - I already know what the attributes are at compile time, so I use .append instead of .reflectionAppend. See attached example + unit test. One side of the bidirectional association must be commented out in the hashCode method. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-456) HashCodeBuilder throws StackOverflowError in bidirectional navigable association
[ https://issues.apache.org/jira/browse/LANG-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell updated LANG-456: --- Fix Version/s: 3.0 HashCodeBuilder throws StackOverflowError in bidirectional navigable association Key: LANG-456 URL: https://issues.apache.org/jira/browse/LANG-456 Project: Commons Lang Issue Type: Bug Affects Versions: 2.4 Environment: Widows XP. Sun JDK 1.5 or 1.6. Reporter: Bob Fields Fix For: 3.0 Attachments: HashCodeBuilderStackOverflow.zip, StackOverflowError.zip This is not the reflection methods, it is the regular HashCodeBuilder append methods. It causes EqualsBuilder, ToStringBuilder, CompareToBuilder to also throw the StackOverflowException, but those methods work when one of the HashCodeBuilder bidirectional association attributes .hashCode() is commented out. The problem is that all of the builders call registerObject() which creates a hashCode, but only the reflectionAppend method checks if an object is registered. Bi-directional associations are a very common pattern in Jaxb and Hibernate. In this case, I generate code from a model in order to avoid the reflection penalty - I already know what the attributes are at compile time, so I use .append instead of .reflectionAppend. See attached example + unit test. One side of the bidirectional association must be commented out in the hashCode method. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-456) HashCodeBuilder throws StackOverflowError in bidirectional navigable association
[ https://issues.apache.org/jira/browse/LANG-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bob Fields updated LANG-456: Attachment: HashCodeBuilderStackOverflow.zip Does anybody even use JDK 1.3 any more? I haven't had it on my machine in years. Here's an updated version with all the Jaxb stuff removed, built with JDK 1.4.2 with compiler compliance level set to JDK 1.3, that should work for you. There's no dependencies other than commons-lang and JUnit. HashCodeBuilder throws StackOverflowError in bidirectional navigable association Key: LANG-456 URL: https://issues.apache.org/jira/browse/LANG-456 Project: Commons Lang Issue Type: Bug Affects Versions: 2.4 Environment: Widows XP. Sun JDK 1.5 or 1.6. Reporter: Bob Fields Attachments: HashCodeBuilderStackOverflow.zip, StackOverflowError.zip This is not the reflection methods, it is the regular HashCodeBuilder append methods. It causes EqualsBuilder, ToStringBuilder, CompareToBuilder to also throw the StackOverflowException, but those methods work when one of the HashCodeBuilder bidirectional association attributes .hashCode() is commented out. The problem is that all of the builders call registerObject() which creates a hashCode, but only the reflectionAppend method checks if an object is registered. Bi-directional associations are a very common pattern in Jaxb and Hibernate. In this case, I generate code from a model in order to avoid the reflection penalty - I already know what the attributes are at compile time, so I use .append instead of .reflectionAppend. See attached example + unit test. One side of the bidirectional association must be commented out in the hashCode method. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-456) HashCodeBuilder throws StackOverflowError in bidirectional navigable association
[ https://issues.apache.org/jira/browse/LANG-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bob Fields updated LANG-456: Attachment: StackOverflowError.zip BidirectionalTest demonstrating StackOverflowError when using non-reflection HashCodeBuilder methods. HashCodeBuilder throws StackOverflowError in bidirectional navigable association Key: LANG-456 URL: https://issues.apache.org/jira/browse/LANG-456 Project: Commons Lang Issue Type: Bug Affects Versions: 2.4 Environment: Widows XP. Sun JDK 1.5 or 1.6. Reporter: Bob Fields Attachments: StackOverflowError.zip This is not the reflection methods, it is the regular HashCodeBuilder append methods. It causes EqualsBuilder, ToStringBuilder, CompareToBuilder to also throw the StackOverflowException, but those methods work when one of the HashCodeBuilder bidirectional association attributes .hashCode() is commented out. The problem is that all of the builders call registerObject() which creates a hashCode, but only the reflectionAppend method checks if an object is registered. Bi-directional associations are a very common pattern in Jaxb and Hibernate. In this case, I generate code from a model in order to avoid the reflection penalty - I already know what the attributes are at compile time, so I use .append instead of .reflectionAppend. See attached example + unit test. One side of the bidirectional association must be commented out in the hashCode method. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.