commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mingleizhang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BCEL-297) Incorrect override implementation of Object.equals
Date Sat, 04 Nov 2017 12:27:01 GMT

    [ https://issues.apache.org/jira/browse/BCEL-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16238958#comment-16238958
] 

mingleizhang commented on BCEL-297:
-----------------------------------

Hey, [~markro] We can just use {{Objects.equals}} to avoid this issue. Instead of throw a
null pointer exception. but a false instead. I will give a PR to this issue. Thanks.

> Incorrect override implementation of Object.equals
> --------------------------------------------------
>
>                 Key: BCEL-297
>                 URL: https://issues.apache.org/jira/browse/BCEL-297
>             Project: Commons BCEL
>          Issue Type: Bug
>            Reporter: Mark Roberts
>            Priority: Minor
>
> classfile/JavaClass.java: 
> classfile/Field.java: 
> classfile/Constant.java:  
> classfile/Method.java:  
> generic/FieldGen.java:   
> generic/MethodGen.java:  
> all define a bcelComparator that overrides Object.equals.  However, they will throw a
null pointer exception for myConstant.equals(null) instead of returning false.  This non-standard
behavior should either be corrected or documented.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message