Skip to content

Commit

Permalink
remove fields
Browse files Browse the repository at this point in the history
  • Loading branch information
sahilagichani14 committed Jan 8, 2025
1 parent 30d00cc commit b4add46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 3 additions & 8 deletions sootup.core/src/main/java/sootup/core/graph/StmtGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@
*/
public abstract class StmtGraph<V extends BasicBlock<V>> implements Iterable<Stmt> {

public final JimplePrinter jimplePrinter = new JimplePrinter();
public final BriefStmtPrinter briefStmtPrinter = new BriefStmtPrinter();

public abstract Stmt getStartingStmt();

public abstract BasicBlock<?> getStartingStmtBlock();
Expand Down Expand Up @@ -357,10 +354,8 @@ public boolean equals(Object o) {
return false;
}

briefStmtPrinter.buildTraps(this);
List<Trap> currTraps = briefStmtPrinter.getTraps();
briefStmtPrinter.buildTraps(otherGraph);
List<Trap> otherGraphTraps = briefStmtPrinter.getTraps();
List<Trap> currTraps = new BriefStmtPrinter(this).getTraps();
List<Trap> otherGraphTraps = new BriefStmtPrinter(otherGraph).getTraps();
if (!currTraps.equals(otherGraphTraps)) {
return false;
}
Expand Down Expand Up @@ -453,7 +448,7 @@ public Stmt next() {
public String toString() {
StringWriter writer = new StringWriter();
try (PrintWriter writerOut = new PrintWriter(new EscapedWriter(writer))) {
jimplePrinter.printTo(this, writerOut);
new JimplePrinter().printTo(this, writerOut);
}
return writer.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* #L%
*/

import sootup.core.graph.StmtGraph;
import sootup.core.jimple.Jimple;
import sootup.core.jimple.common.ref.IdentityRef;
import sootup.core.jimple.common.ref.JCaughtExceptionRef;
Expand All @@ -37,6 +38,10 @@ public BriefStmtPrinter() {
super();
}

public BriefStmtPrinter(StmtGraph stmtGraph) {
buildTraps(stmtGraph);
}

@Override
public void method(SootMethod m) {
handleIndent();
Expand Down

0 comments on commit b4add46

Please sign in to comment.