mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8301492: Modernize equals() method of ResourceBundle.CacheKey and Bundles.CacheKey
Reviewed-by: prappo, naoto
This commit is contained in:
parent
a08352f621
commit
297c799631
2 changed files with 3 additions and 7 deletions
|
@ -719,8 +719,7 @@ public abstract class ResourceBundle {
|
|||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
final CacheKey otherEntry = (CacheKey)other;
|
||||
if (other instanceof CacheKey otherEntry) {
|
||||
//quick check to see if they are not equal
|
||||
if (modulesHash != otherEntry.modulesHash) {
|
||||
return false;
|
||||
|
@ -738,7 +737,6 @@ public abstract class ResourceBundle {
|
|||
Module caller = getCallerModule();
|
||||
return ((module != null) && (module.equals(otherEntry.getModule())) &&
|
||||
(caller != null) && (caller.equals(otherEntry.getCallerModule())));
|
||||
} catch (NullPointerException | ClassCastException e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue