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/ActionExecutionState.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionState.java
index fa7141c..bff051b 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionState.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionState.java
@@ -390,8 +390,8 @@
@Override
public ActionExecutionValue get() throws ActionExecutionException, InterruptedException {
- if (e instanceof InterruptedException) {
- throw (InterruptedException) e;
+ if (e instanceof InterruptedException interruptedException) {
+ throw interruptedException;
}
throw (ActionExecutionException) e;
}