[jira] [Created] (OFBIZ-4422) Using equals() with different object types

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OFBIZ-4422) Using equals() with different object types

Nicolas Malin (Jira)
Using equals() with different object types
------------------------------------------

                 Key: OFBIZ-4422
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4422
             Project: OFBiz
          Issue Type: Bug
          Components: framework
            Reporter: Dimitri Unruh
         Attachments: OFBIZ-4422.patch

In the RunningService.java the equals methods is "buggy":

{code}
    public boolean equals(Object o) {
        if (o != null && o instanceof RunningService) {
            RunningService x = (RunningService) o;
            if (this.model.equals(x) && this.mode == x.getMode() && this.startStamp.equals(x.getStartStamp())) {
                return true;
            }
        }
        return false;
    }
{code}

this.model.equals(x) compares to different classes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-4422) Using equals() with different object types

Nicolas Malin (Jira)

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

Dimitri Unruh updated OFBIZ-4422:
---------------------------------

    Attachment: OFBIZ-4422.patch

> Using equals() with different object types
> ------------------------------------------
>
>                 Key: OFBIZ-4422
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4422
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>            Reporter: Dimitri Unruh
>         Attachments: OFBIZ-4422.patch
>
>
> In the RunningService.java the equals methods is "buggy":
> {code}
>     public boolean equals(Object o) {
>         if (o != null && o instanceof RunningService) {
>             RunningService x = (RunningService) o;
>             if (this.model.equals(x) && this.mode == x.getMode() && this.startStamp.equals(x.getStartStamp())) {
>                 return true;
>             }
>         }
>         return false;
>     }
> {code}
> this.model.equals(x) compares to different classes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Assigned] (OFBIZ-4422) Using equals() with different object types

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Sascha Rodekamp reassigned OFBIZ-4422:
--------------------------------------

    Assignee: Sascha Rodekamp

> Using equals() with different object types
> ------------------------------------------
>
>                 Key: OFBIZ-4422
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4422
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>            Reporter: Dimitri Unruh
>            Assignee: Sascha Rodekamp
>         Attachments: OFBIZ-4422.patch
>
>
> In the RunningService.java the equals methods is "buggy":
> {code}
>     public boolean equals(Object o) {
>         if (o != null && o instanceof RunningService) {
>             RunningService x = (RunningService) o;
>             if (this.model.equals(x) && this.mode == x.getMode() && this.startStamp.equals(x.getStartStamp())) {
>                 return true;
>             }
>         }
>         return false;
>     }
> {code}
> this.model.equals(x) compares to different classes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (OFBIZ-4422) Using equals() with different object types

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Sascha Rodekamp closed OFBIZ-4422.
----------------------------------

       Resolution: Fixed
    Fix Version/s: SVN trunk
                   Release Branch 11.04
                   Release Branch 10.04

Thanks Dimitri,
your Patch is in
Trunk @Rev1173592
10.04 @Rev1173594
11.04 @Rev1173593

> Using equals() with different object types
> ------------------------------------------
>
>                 Key: OFBIZ-4422
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4422
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>            Reporter: Dimitri Unruh
>            Assignee: Sascha Rodekamp
>             Fix For: Release Branch 10.04, Release Branch 11.04, SVN trunk
>
>         Attachments: OFBIZ-4422.patch
>
>
> In the RunningService.java the equals methods is "buggy":
> {code}
>     public boolean equals(Object o) {
>         if (o != null && o instanceof RunningService) {
>             RunningService x = (RunningService) o;
>             if (this.model.equals(x) && this.mode == x.getMode() && this.startStamp.equals(x.getStartStamp())) {
>                 return true;
>             }
>         }
>         return false;
>     }
> {code}
> this.model.equals(x) compares to different classes.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira