public static Type getType(Unit u) { Type t=null; if(u instanceof JAssignStmt){ JAssignStmt as = (JAssignStmt) u; Value right=as.rightBox.getValue(); if (SootUtilities.isNewStmt(as)) t = ((JNewExpr)right).getType(); else if (SootUtilities.isNewArrayStmt(as)) t = ((JNewArrayExpr)right).getType(); else if (SootUtilities.isNewMultiArrayStmt(as)) t = ((JNewMultiArrayExpr)right).getType(); } else { assert (SootUtilities.isInvoke(u)); t = null; } return t; }
public static boolean isNewStmt(JAssignStmt a){ Value right=a.rightBox.getValue(); if(right instanceof JNewExpr) return true; return false; }