You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Pierre-Arnaud Marcelot (JIRA)" <ji...@apache.org> on 2008/11/12 15:39:44 UTC

[jira] Created: (DIRSTUDIO-426) Overwritten hashCode() method should not use super.hashCode()

Overwritten hashCode() method should not use super.hashCode()
-------------------------------------------------------------

                 Key: DIRSTUDIO-426
                 URL: https://issues.apache.org/jira/browse/DIRSTUDIO-426
             Project: Directory Studio
          Issue Type: Improvement
          Components: studio-ldapbrowser, studio-schemaeditor
    Affects Versions: 1.3.0
            Reporter: Pierre-Arnaud Marcelot
            Assignee: Pierre-Arnaud Marcelot
             Fix For: 1.3.1, 1.4.0


Overwritten hashCode() method should not use super.hashCode() because it can cause issues if two objects are equals but does not have the same hashCode.

This problem impacts the following classes:
    * /ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioPagedResultsControl.java
    * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/AttributeTypeWrapper.java
    * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Folder.java
    * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ObjectClassWrapper.java
    * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ProjectWrapper.java
    * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaErrorWrapper.java
    * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWarningWrapper.java
    * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWrapper.java

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


[jira] Commented: (DIRSTUDIO-426) Overwritten hashCode() method should not use super.hashCode()

Posted by "Pierre-Arnaud Marcelot (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSTUDIO-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679538#action_12679538 ] 

Pierre-Arnaud Marcelot commented on DIRSTUDIO-426:
--------------------------------------------------

Actually I'm wondering if this really makes sense to do what I propose on the classes I listed...

These classes are all extending a more abstract class, which has its own specific fields,

If we're not using super.hashCode() anymore, we'll loose some computation done on the fields of this extended classes and maybe we'll not get the result we want, letting 2 objects with different fields values (for the fields of the extended class) have the same hashCode().

I can't really remember what made create this JIRA a few months ago, and I'm not sure now if it really makes sense...

> Overwritten hashCode() method should not use super.hashCode()
> -------------------------------------------------------------
>
>                 Key: DIRSTUDIO-426
>                 URL: https://issues.apache.org/jira/browse/DIRSTUDIO-426
>             Project: Directory Studio
>          Issue Type: Improvement
>          Components: studio-ldapbrowser, studio-schemaeditor
>    Affects Versions: 1.3.0
>            Reporter: Pierre-Arnaud Marcelot
>            Assignee: Pierre-Arnaud Marcelot
>             Fix For: 1.3.1, 1.4.0
>
>
> Overwritten hashCode() method should not use super.hashCode() because it can cause issues if two objects are equals but does not have the same hashCode.
> This problem impacts the following classes:
>     * /ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioPagedResultsControl.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/AttributeTypeWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Folder.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ObjectClassWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ProjectWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaErrorWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWarningWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWrapper.java

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


[jira] Commented: (DIRSTUDIO-426) Overwritten hashCode() method should not use super.hashCode()

Posted by "Felix Knecht (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSTUDIO-426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646919#action_12646919 ] 

Felix Knecht commented on DIRSTUDIO-426:
----------------------------------------

Good catch!
See also http://www.ibm.com/developerworks/java/library/j-jtp05273.html

> Overwritten hashCode() method should not use super.hashCode()
> -------------------------------------------------------------
>
>                 Key: DIRSTUDIO-426
>                 URL: https://issues.apache.org/jira/browse/DIRSTUDIO-426
>             Project: Directory Studio
>          Issue Type: Improvement
>          Components: studio-ldapbrowser, studio-schemaeditor
>    Affects Versions: 1.3.0
>            Reporter: Pierre-Arnaud Marcelot
>            Assignee: Pierre-Arnaud Marcelot
>             Fix For: 1.3.1, 1.4.0
>
>
> Overwritten hashCode() method should not use super.hashCode() because it can cause issues if two objects are equals but does not have the same hashCode.
> This problem impacts the following classes:
>     * /ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioPagedResultsControl.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/AttributeTypeWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Folder.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ObjectClassWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ProjectWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaErrorWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWarningWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWrapper.java

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


[jira] Closed: (DIRSTUDIO-426) Overwritten hashCode() method should not use super.hashCode()

Posted by "Pierre-Arnaud Marcelot (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSTUDIO-426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pierre-Arnaud Marcelot closed DIRSTUDIO-426.
--------------------------------------------

    Resolution: Invalid

We've reviewed it again with Stefan and this JIRA does not make sense.

I was probably tired when I wrote it.

Let's close it.

> Overwritten hashCode() method should not use super.hashCode()
> -------------------------------------------------------------
>
>                 Key: DIRSTUDIO-426
>                 URL: https://issues.apache.org/jira/browse/DIRSTUDIO-426
>             Project: Directory Studio
>          Issue Type: Improvement
>          Components: studio-ldapbrowser, studio-schemaeditor
>    Affects Versions: 1.3.0
>            Reporter: Pierre-Arnaud Marcelot
>            Assignee: Pierre-Arnaud Marcelot
>             Fix For: 1.4.0
>
>
> Overwritten hashCode() method should not use super.hashCode() because it can cause issues if two objects are equals but does not have the same hashCode.
> This problem impacts the following classes:
>     * /ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/StudioPagedResultsControl.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/AttributeTypeWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Folder.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ObjectClassWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ProjectWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaErrorWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWarningWrapper.java
>     * /schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWrapper.java

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