From b99a80f814295eed8a7781192d7f7eb6ae13bdca Mon Sep 17 00:00:00 2001 From: Manu Sridharan Date: Thu, 21 Nov 2024 20:55:35 -0800 Subject: [PATCH] Update to Error Prone 2.36.0 (#1469) The new [DuplicateBranches](https://errorprone.info/bugpattern/DuplicateBranches) check caught some cases which I tried to comment out more clearly for readability. --- .../com/ibm/wala/core/util/ssa/SSAValueManager.java | 13 +++++++------ .../parameters/AndroidModelParameterManager.java | 13 +++++++------ .../androidModel/parameters/ReuseParameters.java | 12 ++++++------ gradle/libs.versions.toml | 2 +- .../prefixtransfer/PrefixTransferGraph.java | 10 +++++----- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValueManager.java b/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValueManager.java index fbc0db0257..9f82b9a81a 100644 --- a/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValueManager.java +++ b/core/src/main/java/com/ibm/wala/core/util/ssa/SSAValueManager.java @@ -262,13 +262,14 @@ public void setPhi(final SSAValue value, SSAInstruction setBy) { info("Closing free SSA Value {} in scope {}", param.value, param.setInScope); param.status = ValueStatus.FREE_CLOSED; } - } else if (param.setInScope < currentScope) { - // param.status = ValueStatus.INVALIDATED; - } else { - // TODO: NO! I JUST WANTED TO ADD THEM! *grrr* - // error("MISSING PHI for " - // throw new IllegalStateException("You forgot Phis in subordinate blocks"); } + // else if (param.setInScope < currentScope) { + // // param.status = ValueStatus.INVALIDATED; + // } else { + // // TODO: NO! I JUST WANTED TO ADD THEM! *grrr* + // // error("MISSING PHI for " + // // throw new IllegalStateException("You forgot Phis in subordinate blocks"); + // } } assert didPhi; return; diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/AndroidModelParameterManager.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/AndroidModelParameterManager.java index a125f92797..99aa792f12 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/AndroidModelParameterManager.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/AndroidModelParameterManager.java @@ -288,13 +288,14 @@ public void setPhi(TypeReference type, int ssaValue, SSAInstruction setBy) { param.status = ValueStatus.FREE_CLOSED; } - } else if (param.setInScope < currentScope) { - // param.status = ValueStatus.INVALIDATED; - } else { - // TODO: NO! I JUST WANTED TO ADD THEM! *grrr* - // logger.error("MISSING PHI for " - // throw new IllegalStateException("You forgot Phis in subordinate blocks"); } + // else if (param.setInScope < currentScope) { + // // param.status = ValueStatus.INVALIDATED; + // } else { + // // TODO: NO! I JUST WANTED TO ADD THEM! *grrr* + // // logger.error("MISSING PHI for " + // // throw new IllegalStateException("You forgot Phis in subordinate blocks"); + // } } assert didPhi; } else { diff --git a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/ReuseParameters.java b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/ReuseParameters.java index 2c28d10029..6e2db5eabd 100644 --- a/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/ReuseParameters.java +++ b/dalvik/src/main/java/com/ibm/wala/dalvik/ipa/callgraph/androidModel/parameters/ReuseParameters.java @@ -154,12 +154,12 @@ public void collectParameters(final Iterable entrypoints) private static int ssaFor(IMethod inCallTo, int paramNo) { assert (paramNo >= 0); assert (paramNo < inCallTo.getNumberOfParameters()); - - if (inCallTo.isStatic()) { - return paramNo + 1; - } else { - return paramNo + 1; // TODO 2 or 1? - } + return paramNo + 1; + // if (inCallTo.isStatic()) { + // return paramNo + 1; + // } else { + // return paramNo + 1; // TODO 2 or 1? + // } } /** diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 792201a6b8..1cc5d57d09 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,7 +16,7 @@ eclipse-ecj = "org.eclipse.jdt:ecj:3.37.0" eclipse-osgi = "org.eclipse.platform:org.eclipse.osgi:3.19.0" eclipse-wst-jsdt-core = { module = "org.eclipse.wst.jsdt:core", version.ref = "eclipse-wst-jsdt" } eclipse-wst-jsdt-ui = { module = "org.eclipse.wst.jsdt:ui", version.ref = "eclipse-wst-jsdt" } -errorprone-core = "com.google.errorprone:error_prone_core:2.35.1" +errorprone-core = "com.google.errorprone:error_prone_core:2.36.0" gradle-download-task = "de.undercouch:gradle-download-task:5.6.0" gradle-errorprone-plugin = "net.ltgt.gradle:gradle-errorprone-plugin:4.1.0" gradle-goomph-plugin = "com.diffplug.gradle:goomph:3.44.0" diff --git a/scandroid/src/main/java/org/scandroid/prefixtransfer/PrefixTransferGraph.java b/scandroid/src/main/java/org/scandroid/prefixtransfer/PrefixTransferGraph.java index 39ec58130b..8660ffe481 100644 --- a/scandroid/src/main/java/org/scandroid/prefixtransfer/PrefixTransferGraph.java +++ b/scandroid/src/main/java/org/scandroid/prefixtransfer/PrefixTransferGraph.java @@ -53,7 +53,6 @@ import com.ibm.wala.ipa.callgraph.CGNode; import com.ibm.wala.ipa.callgraph.Context; import com.ibm.wala.ipa.callgraph.ContextKey; -import com.ibm.wala.ipa.callgraph.propagation.AllocationSite; import com.ibm.wala.ipa.callgraph.propagation.AllocationSiteInNode; import com.ibm.wala.ipa.callgraph.propagation.ConstantKey; import com.ibm.wala.ipa.callgraph.propagation.InstanceKey; @@ -170,11 +169,12 @@ public PrefixTransferGraph(PointerAnalysis pa) { // } } } - } else if (k instanceof AllocationSite) { - - } else { - } + // else if (k instanceof AllocationSite) { + // + // } else { + // + // } // create an edge for dependencies used in the creation of each instance key } else {