[jboss-jira] [JBoss JIRA] (WFLY-7935) DeploymentRestResourcesDefintion inner classes override compareTo, but not equals() and hashcode()

Romain Pelisse (JIRA) issues at jboss.org
Mon Jan 23 05:18:01 EST 2017


     [ https://issues.jboss.org/browse/WFLY-7935?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Romain Pelisse updated WFLY-7935:
---------------------------------
    Affects Version/s: 10.1.0.Final


> DeploymentRestResourcesDefintion inner classes override compareTo, but not equals() and hashcode()
> --------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-7935
>                 URL: https://issues.jboss.org/browse/WFLY-7935
>             Project: WildFly
>          Issue Type: Bug
>          Components: REST
>    Affects Versions: 10.1.0.Final
>            Reporter: Romain Pelisse
>            Assignee: Romain Pelisse
>            Priority: Minor
>
> JaxrsResourceMethodDescription [1] and JaxrsResourceLocatorDescription [2] classes override compareTo() method but they don't override equals() and hascode().
> Javadoc says [3]:
> "It is strongly recommended (though not required) that natural orderings be consistent with equals. "
> Implemented compareTo() compares object based on the class name, but the default implementation of Object for equals() compares objects based on the object reference, thus there is inconsistency.
> [1] https://github.com/wildfly/wildfly/blob/master/jaxrs/src/main/java/org/jboss/as/jaxrs/DeploymentRestResourcesDefintion.java#L389
> [2] https://github.com/wildfly/wildfly/blob/master/jaxrs/src/main/java/org/jboss/as/jaxrs/DeploymentRestResourcesDefintion.java#L347
> [3] http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list