Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/java.base/share/classes/java/util/Objects.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
package java.util;

import jdk.internal.javac.PreviewFeature;
import jdk.internal.misc.PreviewFeatures;
import jdk.internal.util.Preconditions;
import jdk.internal.vm.annotation.ForceInline;

Expand Down Expand Up @@ -62,12 +61,7 @@ private Objects() {
*/
@ForceInline
public static boolean equals(Object a, Object b) {
if (PreviewFeatures.isEnabled()) {
// With --enable-preview avoid acmp
return (a == null) ? b == null : a.equals(b);
} else {
return (a == b) || (a != null && a.equals(b));
}
return (a == b) || (a != null && a.equals(b));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ public SimpleValue(Serializable o, int i) {
this.i = i;
}

public boolean equals(Object obj) {
if (obj instanceof SimpleValue simpleValue) {
return (i == simpleValue.i && Objects.equals(this.obj, simpleValue.obj));
public boolean equals(Object other) {
if (other instanceof SimpleValue simpleValue) {
return (i == simpleValue.i && Objects.equals(obj, simpleValue.obj));
}
return false;
}
Expand Down