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/skyframe/ActionTemplateExpansionValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionValue.java
index c8b1559..29d0e91 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionTemplateExpansionValue.java
@@ -104,10 +104,9 @@
if (this == obj) {
return true;
}
- if (!(obj instanceof ActionTemplateExpansionKey)) {
+ if (!(obj instanceof ActionTemplateExpansionKey that)) {
return false;
}
- ActionTemplateExpansionKey that = (ActionTemplateExpansionKey) obj;
return this.actionIndex == that.actionIndex
&& this.actionLookupKey.equals(that.actionLookupKey);
}