RFR: 8258422: Cleanup unnecessary null comparison before instanceof check in java.base [v4]
    Alan Bateman 
    alanb at openjdk.java.net
       
    Thu Dec 17 13:38:57 UTC 2020
    
    
  
On Thu, 17 Dec 2020 13:32:06 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Actually, I'm not sure if `oth` is better name for variable than `other1`.
>> I would say they have the same rank :)
>
> I believe Alan is suggesting to do:
> 
>     /**
>      * Compares the equality of two <code>Signal</code> objects.
>      *
>      * @param obj the object to compare with.
>      * @return whether two <code>Signal</code> objects are equal.
>      */
>     public boolean equals(Object obj) {
>         if (this == obj) {
> 
> this leaves the variable name `other` free for later use inside the method.
> Actually, I'm not sure if `oth` is better name for variable than `other1`.
> I would say they have the same rank :)
Sorry, I should have been clearer, the comment was about equals(Object other). If you rename "other" then it will avoid "other1"
-------------
PR: https://git.openjdk.java.net/jdk/pull/20
    
    
More information about the net-dev
mailing list