diff --git a/sootup.java.core/src/main/java/sootup/java/core/interceptors/CopyPropagator.java b/sootup.java.core/src/main/java/sootup/java/core/interceptors/CopyPropagator.java index 6c34369dedd..33cc785bb14 100644 --- a/sootup.java.core/src/main/java/sootup/java/core/interceptors/CopyPropagator.java +++ b/sootup.java.core/src/main/java/sootup/java/core/interceptors/CopyPropagator.java @@ -96,7 +96,7 @@ else if (rhs instanceof Local && !rhs.equivTo(use)) { Local m = (Local) rhs; if (use != m) { Integer defCount = m.getDefs(stmtGraph.getStmts()).size(); - if (defCount == null || defCount == 0) { + if (defCount == 0) { throw new RuntimeException("Variable " + m + " used without definition!"); } else if (defCount == 1) { newStmt = replaceUse(stmtGraph, newStmt, use, rhs); @@ -142,7 +142,7 @@ else if (rhs instanceof Local && !rhs.equivTo(use)) { private Stmt replaceUse( @Nonnull MutableStmtGraph graph, @Nonnull Stmt stmt, @Nonnull Value use, @Nonnull Value rhs) { - if (!use.equivTo(rhs)) { // TODO: ms: check if rhs!=use would be enough + if (rhs != use) { Stmt newStmt = stmt.withNewUse(use, rhs); if (newStmt != stmt) { graph.replaceNode(stmt, newStmt);