Run IntelliJ's "Pattern variable can be used" inspection on entire codebase. This is a machine-generated CL. Bazel does a lot of downcasting, much of it necessary due to the runtime-dynamic and configurable nature of the system. Using JEP394 to ergonomically downcast saves a line of distracting boilerplate which adds up with hundreds of downcasts. #jdk21 #jep394 PiperOrigin-RevId: 625454340 Change-Id: I4f21253f855128df271a100ec19a578d5af1ec1c
diff --git a/src/main/java/com/google/devtools/build/lib/actions/RunfilesArtifactValue.java b/src/main/java/com/google/devtools/build/lib/actions/RunfilesArtifactValue.java index 5d697b2..a3e933d 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/RunfilesArtifactValue.java +++ b/src/main/java/com/google/devtools/build/lib/actions/RunfilesArtifactValue.java
@@ -112,10 +112,9 @@ if (this == o) { return true; } - if (!(o instanceof RunfilesArtifactValue)) { + if (!(o instanceof RunfilesArtifactValue that)) { return false; } - RunfilesArtifactValue that = (RunfilesArtifactValue) o; return metadata.equals(that.metadata) && files.equals(that.files) && fileValues.equals(that.fileValues)