From: <no...@at...> - 2006-04-06 22:34:27
|
Bad code in FastClass.equals ---------------------------- Key: HHH-1646 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH= -1646 Project: Hibernate3 Type: Bug Versions: 3.1.3, 3.2.0 cr1 =20 Environment: 3.2.0 Reporter: Niels Harremo=C3=ABs Priority: Trivial In FastClass, the equals method is: public boolean equals(Object o) { if ( o =3D=3D null || ( o instanceof FastClass ) ) { return false; } return this.type.equals( ( ( FastClass ) o ).type ); } There's a missing ! - the first line should be=20 if ( o =3D=3D null || ! ( o instanceof FastClass ) ) { --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-04-07 06:56:26
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1646?p= age=3Dall ] Max Rydahl Andersen updated HHH-1646: ------------------------------------- Priority: Blocker (was: Trivial) higher priority - need to apply to proper 3.2 branch too. > Bad code in FastClass.equals > ---------------------------- > > Key: HHH-1646 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1646 > Project: Hibernate3 > Type: Bug > Versions: 3.1.3, 3.2.0 cr1 > Environment: 3.2.0 > Reporter: Niels Harremo=C3=ABs > Priority: Blocker > > Original Estimate: 3 minutes > Remaining: 3 minutes > > In FastClass, the equals method is: > public boolean equals(Object o) { > if ( o =3D=3D null || ( o instanceof FastClass ) ) { > return false; > } > return this.type.equals( ( ( FastClass ) o ).type ); > } > There's a missing ! - the first line should be=20 > if ( o =3D=3D null || ! ( o instanceof FastClass ) ) { --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Konstantin I. (JIRA) <no...@at...> - 2006-05-19 16:44:16
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1646?p= age=3Dall ] Konstantin Ignatyev updated HHH-1646: ------------------------------------- Attachment: FastClass.patch Patch that implements that > Bad code in FastClass.equals > ---------------------------- > > Key: HHH-1646 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1646 > Project: Hibernate3 > Type: Bug > Versions: 3.1.3, 3.2.0 cr1 > Environment: 3.2.0 > Reporter: Niels Harremo=C3=ABs > Priority: Blocker > Attachments: FastClass.patch > > Original Estimate: 3 minutes > Remaining: 3 minutes > > In FastClass, the equals method is: > public boolean equals(Object o) { > if ( o =3D=3D null || ( o instanceof FastClass ) ) { > return false; > } > return this.type.equals( ( ( FastClass ) o ).type ); > } > There's a missing ! - the first line should be=20 > if ( o =3D=3D null || ! ( o instanceof FastClass ) ) { --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Greg M. (JIRA) <no...@at...> - 2006-05-22 00:46:28
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1646?pa= ge=3Dcomments#action_23140 ]=20 Greg Matthews commented on HHH-1646: ------------------------------------ You don't strictly really need the null check either. The instanceof operat= or handles null. i.e. the following will work just fine. if(o instanceof FastClass) { return this.type.equals(((FastClass)o).type); } return false; // if o is null, we'll return false > Bad code in FastClass.equals > ---------------------------- > > Key: HHH-1646 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1646 > Project: Hibernate3 > Type: Bug > Versions: 3.1.3, 3.2.0 cr1 > Environment: 3.2.0 > Reporter: Niels Harremo=C3=ABs > Priority: Blocker > Attachments: FastClass.patch > > Original Estimate: 3 minutes > Remaining: 3 minutes > > In FastClass, the equals method is: > public boolean equals(Object o) { > if ( o =3D=3D null || ( o instanceof FastClass ) ) { > return false; > } > return this.type.equals( ( ( FastClass ) o ).type ); > } > There's a missing ! - the first line should be=20 > if ( o =3D=3D null || ! ( o instanceof FastClass ) ) { --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-07-20 08:52:13
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1646?pa= ge=3Dcomments#action_23695 ]=20 Max Rydahl Andersen commented on HHH-1646: ------------------------------------------ greg: no, null instanceof X is always true. > Bad code in FastClass.equals > ---------------------------- > > Key: HHH-1646 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1646 > Project: Hibernate3 > Type: Bug > Versions: 3.1.3, 3.2.0 cr1 > Environment: 3.2.0 > Reporter: Niels Harremo=C3=ABs > Priority: Blocker > Attachments: FastClass.patch > > Original Estimate: 3 minutes > Remaining: 3 minutes > > In FastClass, the equals method is: > public boolean equals(Object o) { > if ( o =3D=3D null || ( o instanceof FastClass ) ) { > return false; > } > return this.type.equals( ( ( FastClass ) o ).type ); > } > There's a missing ! - the first line should be=20 > if ( o =3D=3D null || ! ( o instanceof FastClass ) ) { --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Max R. A. (JIRA) <no...@at...> - 2006-07-20 08:56:12
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1646?pa= ge=3Dcomments#action_23696 ]=20 Max Rydahl Andersen commented on HHH-1646: ------------------------------------------ scratch that - i negated one time to many ;) > Bad code in FastClass.equals > ---------------------------- > > Key: HHH-1646 > URL: http://opensource.atlassian.com/projects/hibernate/browse/H= HH-1646 > Project: Hibernate3 > Type: Bug > Versions: 3.1.3, 3.2.0 cr1 > Environment: 3.2.0 > Reporter: Niels Harremo=C3=ABs > Priority: Blocker > Attachments: FastClass.patch > > Original Estimate: 3 minutes > Remaining: 3 minutes > > In FastClass, the equals method is: > public boolean equals(Object o) { > if ( o =3D=3D null || ( o instanceof FastClass ) ) { > return false; > } > return this.type.equals( ( ( FastClass ) o ).type ); > } > There's a missing ! - the first line should be=20 > if ( o =3D=3D null || ! ( o instanceof FastClass ) ) { --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators= .jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |