OSDN Git Service

save
[jcfa/jcfa.git] / jcfa / src / jp / igapyon / jcfa / util / JcfaWriteUtil.java
index b090b0b..6c5d8fe 100644 (file)
@@ -11,10 +11,9 @@ import jp.igapyon.jcfa.vo.JcfaComment;
 import jp.igapyon.jcfa.vo.JcfaField;
 import jp.igapyon.jcfa.vo.JcfaMethod;
 import jp.igapyon.jcfa.vo.JcfaUnit;
-import jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable;
-import jp.igapyon.jcfa.vo.operandstack.JcfaOSNode;
-import jp.igapyon.jcfa.vo.operandstack.JcfaOSRef;
-import jp.igapyon.jcfa.vo.operandstack.JcfaOSString;
+import jp.igapyon.jcfa.vo.item.JcfaItem;
+import jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable;
+import jp.igapyon.jcfa.vo.item.JcfaItemReference;
 
 import org.apache.bcel.Constants;
 import org.apache.bcel.classfile.JavaClass;
@@ -141,7 +140,7 @@ public class JcfaWriteUtil {
 
                        switch (jcfaCode.getOpcode()) {
                        case Constants.ALOAD_0: {
-                               final JcfaOSLocalVariable osLocalVariable = new JcfaOSLocalVariable();
+                               final JcfaItemLocalVariable osLocalVariable = new JcfaItemLocalVariable();
                                jcfaMethod.getFrame().getOperandStack().push(osLocalVariable);
                                osLocalVariable.setLocalVariable(jcfaMethod.getFrame()
                                                .getLocalVariableList().get(0));
@@ -155,22 +154,21 @@ public class JcfaWriteUtil {
                                break;
                        }
                        case Constants.GETSTATIC: {
-                               final JcfaOSRef osRef = new JcfaOSRef();
+                               final JcfaItemReference osRef = new JcfaItemReference();
                                jcfaMethod.getFrame().getOperandStack().push(osRef);
-                               osRef.setClassName(JcfaUtil.getConstantFieldrefString(jc,
+                               osRef.setObject(JcfaUtil.getConstantFieldrefString(jc,
                                                codes[1], codes[2]));
 
-                               jcfaCode.getComment().getCommentList()
-                                               .add(osRef.getClassName());
+                               jcfaCode.getComment().getCommentList().add(osRef.getObject());
                                break;
                        }
                        case Constants.LDC: {
-                               final JcfaOSString osString = new JcfaOSString();
+                               final JcfaItemReference osString = new JcfaItemReference();
                                jcfaMethod.getFrame().getOperandStack().push(osString);
-                               osString.setString(JcfaUtil.getConstantString(jc, codes[1]));
+                               osString.setObject(JcfaUtil.getConstantString(jc, codes[1]));
 
                                jcfaCode.getComment().getCommentList()
-                                               .add(osString.getString());
+                                               .add(osString.getObject());
                        }
                                break;
                        case Constants.INVOKEVIRTUAL:
@@ -183,15 +181,15 @@ public class JcfaWriteUtil {
                                jcfaCode.getComment().getCommentList()
                                                .add("TODO get args count from signature.");
                                // get n args.
-                               final JcfaOSNode osNodeArg0 = jcfaMethod.getFrame()
+                               final JcfaItem osNodeArg0 = jcfaMethod.getFrame()
                                                .getOperandStack().pop();
 
-                               final JcfaOSRef osRef = (JcfaOSRef) jcfaMethod.getFrame()
-                                               .getOperandStack().pop();
+                               final JcfaItemReference osRef = (JcfaItemReference) jcfaMethod
+                                               .getFrame().getOperandStack().pop();
 
                                jcfaCode.getComment()
                                                .getCommentList()
-                                               .add("" + osRef.getClassName() + "#"
+                                               .add("" + osRef.getObject() + "#"
                                                                + osNodeArg0.toString());
 
                        }