RFR: 8263358: Update java.lang to use instanceof pattern variable [v3]
Patrick Concannon
pconcannon at openjdk.java.net
Thu Mar 11 16:42:25 UTC 2021
On Thu, 11 Mar 2021 08:56:00 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8263358: Refactored equals methods
>
> src/java.base/share/classes/java/lang/module/ModuleDescriptor.java line 313:
>
>> 311: @Override
>> 312: public boolean equals(Object ob) {
>> 313: if (!(ob instanceof Requires that))
>
> it would be nicer if you inverted this to return (ob instanced Requires that) && ...
> Same thing for the equals methods in Exports, Opens, Provides, ...
I've refactored the various equals methods now, and they can be viewed in commit e9d9131
-------------
PR: https://git.openjdk.java.net/jdk/pull/2913
More information about the core-libs-dev
mailing list