Use regexp to use JEP394 where IntelliJ inspection fails.
PCRE regexp: `(\w+) instanceof ([A-Z]\w+)((\)|;)?.*\n.*)\(\2\) \1`
Replaced with: `$1 instanceof $2 roflmao$3roflmao`
Then processed with a Ruby script to rewrite `roflmao` with the name of the class, lowercasing the first letter.
Then I used the IntelliJ "Remove unnecessary parentheses" inspection.
#jdk21 #jep391
PiperOrigin-RevId: 628255645
Change-Id: I74031b97efa72636fdccb1c2473bc3a5f92ad7e9
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java
index 42e0cd9..0151bc0 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/RecursiveFilesystemTraversalFunction.java
@@ -335,8 +335,8 @@
if (value instanceof FileArtifactValue || value instanceof TreeArtifactValue) {
fsVal = (HasDigest) value;
- } else if (value instanceof ActionExecutionValue) {
- fsVal = ((ActionExecutionValue) value).getExistingFileArtifactValue(artifact);
+ } else if (value instanceof ActionExecutionValue actionExecutionValue) {
+ fsVal = actionExecutionValue.getExistingFileArtifactValue(artifact);
} else {
return NON_EXISTENT_FILE_INFO;
}