You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "mingleizhang (JIRA)" <ji...@apache.org> on 2017/11/04 12:27:01 UTC
[jira] [Commented] (BCEL-297) Incorrect override implementation of
Object.equals
[ 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)