From 0d4183b914a5d99509c70f9d0b3db45c2e631975 Mon Sep 17 00:00:00 2001 From: egeay Date: Wed, 7 May 2008 18:22:37 +0000 Subject: [PATCH] NormalStatement is a natural subclass of StatementWithInstructionIndex git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2788 f5eafffb-2e1d-0410-98e4-8ec43c5233c4 --- .../ibm/wala/ipa/slicer/NormalStatement.java | 37 +------------------ 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/NormalStatement.java b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/NormalStatement.java index 4e96699a7..eb1590d23 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/NormalStatement.java +++ b/com.ibm.wala.core/src/com/ibm/wala/ipa/slicer/NormalStatement.java @@ -11,7 +11,6 @@ package com.ibm.wala.ipa.slicer; import com.ibm.wala.ipa.callgraph.CGNode; -import com.ibm.wala.ssa.SSAInstruction; /** * A statement that has a corresponding index in the @@ -19,16 +18,10 @@ import com.ibm.wala.ssa.SSAInstruction; * * @author sjfink */ -public class NormalStatement extends Statement { +public class NormalStatement extends StatementWithInstructionIndex { - /** - * Index of the instruction in the SSA IR - */ - private final int instructionIndex; - public NormalStatement(CGNode node, int instructionIndex) { - super(node); - this.instructionIndex = instructionIndex; + super(node, instructionIndex); } @Override @@ -36,35 +29,9 @@ public class NormalStatement extends Statement { return Kind.NORMAL; } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass().equals(obj.getClass())) { - NormalStatement other = (NormalStatement) obj; - return getNode().equals(other.getNode()) && instructionIndex == other.instructionIndex; - } else { - return false; - } - } - - @Override - public int hashCode() { - return 3691 * instructionIndex + getNode().hashCode(); - } - @Override public String toString() { return "NORMAL " + getNode().getMethod().getName() + ":" + getInstruction().toString() + " " + getNode(); } - - public SSAInstruction getInstruction() { - return getNode().getIR().getInstructions()[instructionIndex]; - } - - public int getInstructionIndex() { - return instructionIndex; - } }