• R/O
  • HTTP
  • SSH
  • HTTPS

jcfa: Commit

JavaClassFileAnalyzer (jcfa) のメインリポジトリです。


Commit MetaInfo

Revision9bc987811de806f044416e1b6bc22d5d591b054a (tree)
Time2014-04-03 21:33:23
Authoriga <tosiki.iga@nift...>
Commiteriga

Log Message

save

Change Summary

Incremental Difference

--- a/jcfa/src/jp/igapyon/jcfa/util/JcfaWriteUtil.java
+++ b/jcfa/src/jp/igapyon/jcfa/util/JcfaWriteUtil.java
@@ -11,10 +11,9 @@ import jp.igapyon.jcfa.vo.JcfaComment;
1111 import jp.igapyon.jcfa.vo.JcfaField;
1212 import jp.igapyon.jcfa.vo.JcfaMethod;
1313 import jp.igapyon.jcfa.vo.JcfaUnit;
14-import jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable;
15-import jp.igapyon.jcfa.vo.operandstack.JcfaOSNode;
16-import jp.igapyon.jcfa.vo.operandstack.JcfaOSRef;
17-import jp.igapyon.jcfa.vo.operandstack.JcfaOSString;
14+import jp.igapyon.jcfa.vo.item.JcfaItem;
15+import jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable;
16+import jp.igapyon.jcfa.vo.item.JcfaItemReference;
1817
1918 import org.apache.bcel.Constants;
2019 import org.apache.bcel.classfile.JavaClass;
@@ -141,7 +140,7 @@ public class JcfaWriteUtil {
141140
142141 switch (jcfaCode.getOpcode()) {
143142 case Constants.ALOAD_0: {
144- final JcfaOSLocalVariable osLocalVariable = new JcfaOSLocalVariable();
143+ final JcfaItemLocalVariable osLocalVariable = new JcfaItemLocalVariable();
145144 jcfaMethod.getFrame().getOperandStack().push(osLocalVariable);
146145 osLocalVariable.setLocalVariable(jcfaMethod.getFrame()
147146 .getLocalVariableList().get(0));
@@ -155,22 +154,21 @@ public class JcfaWriteUtil {
155154 break;
156155 }
157156 case Constants.GETSTATIC: {
158- final JcfaOSRef osRef = new JcfaOSRef();
157+ final JcfaItemReference osRef = new JcfaItemReference();
159158 jcfaMethod.getFrame().getOperandStack().push(osRef);
160- osRef.setClassName(JcfaUtil.getConstantFieldrefString(jc,
159+ osRef.setObject(JcfaUtil.getConstantFieldrefString(jc,
161160 codes[1], codes[2]));
162161
163- jcfaCode.getComment().getCommentList()
164- .add(osRef.getClassName());
162+ jcfaCode.getComment().getCommentList().add(osRef.getObject());
165163 break;
166164 }
167165 case Constants.LDC: {
168- final JcfaOSString osString = new JcfaOSString();
166+ final JcfaItemReference osString = new JcfaItemReference();
169167 jcfaMethod.getFrame().getOperandStack().push(osString);
170- osString.setString(JcfaUtil.getConstantString(jc, codes[1]));
168+ osString.setObject(JcfaUtil.getConstantString(jc, codes[1]));
171169
172170 jcfaCode.getComment().getCommentList()
173- .add(osString.getString());
171+ .add(osString.getObject());
174172 }
175173 break;
176174 case Constants.INVOKEVIRTUAL:
@@ -183,15 +181,15 @@ public class JcfaWriteUtil {
183181 jcfaCode.getComment().getCommentList()
184182 .add("TODO get args count from signature.");
185183 // get n args.
186- final JcfaOSNode osNodeArg0 = jcfaMethod.getFrame()
184+ final JcfaItem osNodeArg0 = jcfaMethod.getFrame()
187185 .getOperandStack().pop();
188186
189- final JcfaOSRef osRef = (JcfaOSRef) jcfaMethod.getFrame()
190- .getOperandStack().pop();
187+ final JcfaItemReference osRef = (JcfaItemReference) jcfaMethod
188+ .getFrame().getOperandStack().pop();
191189
192190 jcfaCode.getComment()
193191 .getCommentList()
194- .add("" + osRef.getClassName() + "#"
192+ .add("" + osRef.getObject() + "#"
195193 + osNodeArg0.toString());
196194
197195 }
--- a/jcfa/src/jp/igapyon/jcfa/vo/JcfaOperandStack.java
+++ b/jcfa/src/jp/igapyon/jcfa/vo/JcfaOperandStack.java
@@ -3,22 +3,22 @@ package jp.igapyon.jcfa.vo;
33 import java.util.EmptyStackException;
44 import java.util.Stack;
55
6-import jp.igapyon.jcfa.vo.operandstack.JcfaOSNode;
7-import jp.igapyon.jcfa.vo.operandstack.JcfaOSRef;
6+import jp.igapyon.jcfa.vo.item.JcfaItem;
7+import jp.igapyon.jcfa.vo.item.JcfaItemReference;
88
99 public class JcfaOperandStack {
10- protected final Stack<JcfaOSNode> operandStack = new Stack<JcfaOSNode>();
10+ protected final Stack<JcfaItem> operandStack = new Stack<JcfaItem>();
1111
12- public void push(final JcfaOSNode operandStackNode) {
12+ public void push(final JcfaItem operandStackNode) {
1313 operandStack.push(operandStackNode);
1414 }
1515
16- public JcfaOSNode pop() {
16+ public JcfaItem pop() {
1717 try {
1818 return operandStack.pop();
1919 } catch (EmptyStackException ex) {
2020 ex.printStackTrace();
21- return new JcfaOSRef();
21+ return new JcfaItemReference();
2222 }
2323 }
2424 }
--- /dev/null
+++ b/jcfa/src/jp/igapyon/jcfa/vo/item/JcfaItem.java
@@ -0,0 +1,4 @@
1+package jp.igapyon.jcfa.vo.item;
2+
3+public abstract class JcfaItem {
4+}
--- a/jcfa/src/jp/igapyon/jcfa/vo/operandstack/JcfaOSLocalVariable.java
+++ b/jcfa/src/jp/igapyon/jcfa/vo/item/JcfaItemLocalVariable.java
@@ -1,8 +1,8 @@
1-package jp.igapyon.jcfa.vo.operandstack;
1+package jp.igapyon.jcfa.vo.item;
22
33 import jp.igapyon.jcfa.vo.JcfaLocalVariable;
44
5-public class JcfaOSLocalVariable extends JcfaOSNode {
5+public class JcfaItemLocalVariable extends JcfaItem {
66 protected JcfaLocalVariable localVariable;
77
88 public JcfaLocalVariable getLocalVariable() {
--- /dev/null
+++ b/jcfa/src/jp/igapyon/jcfa/vo/item/JcfaItemReference.java
@@ -0,0 +1,13 @@
1+package jp.igapyon.jcfa.vo.item;
2+
3+public class JcfaItemReference extends JcfaItem {
4+ protected String object;
5+
6+ public String getObject() {
7+ return object;
8+ }
9+
10+ public void setObject(String object) {
11+ this.object = object;
12+ }
13+}
--- a/jcfa/src/jp/igapyon/jcfa/vo/operandstack/JcfaOSNode.java
+++ /dev/null
@@ -1,4 +0,0 @@
1-package jp.igapyon.jcfa.vo.operandstack;
2-
3-public abstract class JcfaOSNode {
4-}
--- a/jcfa/src/jp/igapyon/jcfa/vo/operandstack/JcfaOSRef.java
+++ /dev/null
@@ -1,13 +0,0 @@
1-package jp.igapyon.jcfa.vo.operandstack;
2-
3-public class JcfaOSRef extends JcfaOSNode {
4- protected String className;
5-
6- public String getClassName() {
7- return className;
8- }
9-
10- public void setClassName(String className) {
11- this.className = className;
12- }
13-}
--- a/jcfa/src/jp/igapyon/jcfa/vo/operandstack/JcfaOSString.java
+++ /dev/null
@@ -1,13 +0,0 @@
1-package jp.igapyon.jcfa.vo.operandstack;
2-
3-public class JcfaOSString extends JcfaOSNode {
4- protected String string;
5-
6- public String getString() {
7- return string;
8- }
9-
10- public void setString(String string) {
11- this.string = string;
12- }
13-}
--- a/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaField.jcfa
+++ b/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaField.jcfa
@@ -20,7 +20,7 @@ public class JcfaField extends jp.igapyon.jcfa.vo.JcfaNode {
2020 /*
2121 * 1: invokespecial jp/igapyon/jcfa/vo/JcfaNode#<init>()V TODO get args
2222 * count from signature.
23- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@132a3e
23+ * null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@118dc75
2424 */
2525
2626 /* 4: return */
--- a/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaFrame.jcfa
+++ b/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaFrame.jcfa
@@ -15,8 +15,7 @@ public class JcfaFrame {
1515
1616 /*
1717 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
18- * signature.
19- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@1e6c23c
18+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@9046f8
2019 */
2120
2221 /*
@@ -34,7 +33,7 @@ public class JcfaFrame {
3433 /*
3534 * 9: invokespecial java/util/ArrayList#<init>()V TODO get args count
3635 * from signature.
37- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@da1a1f
36+ * null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@2364e5
3837 */
3938
4039 /*
@@ -56,7 +55,7 @@ public class JcfaFrame {
5655 /*
5756 * 20: invokespecial jp/igapyon/jcfa/vo/JcfaOperandStack#<init>()V TODO
5857 * get args count from signature.
59- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@e9055b
58+ * null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@1b51748
6059 */
6160
6261 /*
--- a/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaMethod.jcfa
+++ b/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaMethod.jcfa
@@ -24,7 +24,7 @@ public class JcfaMethod extends jp.igapyon.jcfa.vo.JcfaNode {
2424 /*
2525 * 1: invokespecial jp/igapyon/jcfa/vo/JcfaNode#<init>()V TODO get args
2626 * count from signature.
27- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@3a4d82
27+ * null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@131a5af
2828 */
2929
3030 /*
@@ -42,7 +42,7 @@ public class JcfaMethod extends jp.igapyon.jcfa.vo.JcfaNode {
4242 /*
4343 * 9: invokespecial java/util/ArrayList#<init>()V TODO get args count
4444 * from signature.
45- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@1b6aea4
45+ * null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@74c252
4646 */
4747
4848 /*
@@ -64,7 +64,7 @@ public class JcfaMethod extends jp.igapyon.jcfa.vo.JcfaNode {
6464 /*
6565 * 20: invokespecial java/util/ArrayList#<init>()V TODO get args count
6666 * from signature.
67- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@83d070
67+ * null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@181ab44
6868 */
6969
7070 /*
@@ -86,7 +86,7 @@ public class JcfaMethod extends jp.igapyon.jcfa.vo.JcfaNode {
8686 /*
8787 * 31: invokespecial jp/igapyon/jcfa/vo/JcfaFrame#<init>()V TODO get
8888 * args count from signature.
89- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@1e9749c
89+ * null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@132a3e
9090 */
9191
9292 /*
--- a/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaNode.jcfa
+++ b/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaNode.jcfa
@@ -13,8 +13,7 @@ public class JcfaNode {
1313
1414 /*
1515 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
16- * signature.
17- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@5eae58
16+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@ba2e7
1817 */
1918
2019 /*
@@ -32,7 +31,7 @@ public class JcfaNode {
3231 /*
3332 * 9: invokespecial jp/igapyon/jcfa/vo/JcfaComment#<init>()V TODO get
3433 * args count from signature.
35- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@841c1
34+ * null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@1f3f6ff
3635 */
3736
3837 /*
--- a/jcfa/testJavaClass/output/test/TestJavaClass001.jcfa
+++ b/jcfa/testJavaClass/output/test/TestJavaClass001.jcfa
@@ -10,8 +10,7 @@ public class TestJavaClass001 {
1010
1111 /*
1212 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
13- * signature.
14- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@1670f2b
13+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@ffab3f
1514 */
1615
1716 /* 4: return */
@@ -33,7 +32,7 @@ public class TestJavaClass001 {
3332 * 5: invokevirtual java/io/PrintStream#println(Ljava/lang/String;)V
3433 * TODO get args count from signature. java.lang.System#out
3534 * type:Ljava/io
36- * /PrintStream;#jp.igapyon.jcfa.vo.operandstack.JcfaOSString@114f7c0
35+ * /PrintStream;#jp.igapyon.jcfa.vo.item.JcfaItemReference@143c919
3736 */
3837
3938 /* 8: return */
--- a/jcfa/testJavaClass/output/test/TestJavaClass002.jcfa
+++ b/jcfa/testJavaClass/output/test/TestJavaClass002.jcfa
@@ -20,8 +20,7 @@ public class TestJavaClass002 {
2020
2121 /*
2222 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
23- * signature.
24- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@164813b
23+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@1bc378f
2524 */
2625
2726 /*
--- a/jcfa/testJavaClass/output/test/TestJavaClass003.jcfa
+++ b/jcfa/testJavaClass/output/test/TestJavaClass003.jcfa
@@ -25,8 +25,7 @@ public class TestJavaClass003 {
2525
2626 /*
2727 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
28- * signature.
29- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@1bc378f
28+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@1d0bf38
3029 */
3130
3231 /*
--- a/jcfa/testJavaClass/output/test/TestJavaClass011.jcfa
+++ b/jcfa/testJavaClass/output/test/TestJavaClass011.jcfa
@@ -10,8 +10,7 @@ public class TestJavaClass011 {
1010
1111 /*
1212 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
13- * signature.
14- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@e1ccdf
13+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@15c0729
1514 */
1615
1716 /* 4: return */
@@ -31,7 +30,7 @@ public class TestJavaClass011 {
3130 * 5: invokevirtual java/io/PrintStream#println(Ljava/lang/String;)V
3231 * TODO get args count from signature. java.lang.System#out
3332 * type:Ljava/io
34- * /PrintStream;#jp.igapyon.jcfa.vo.operandstack.JcfaOSString@51762a
33+ * /PrintStream;#jp.igapyon.jcfa.vo.item.JcfaItemReference@da1c9f
3534 */
3635
3736 /* 8: return */
--- a/jcfa/testJavaClass/output/test/TestJavaClass021.jcfa
+++ b/jcfa/testJavaClass/output/test/TestJavaClass021.jcfa
@@ -10,8 +10,7 @@ public class TestJavaClass021 {
1010
1111 /*
1212 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
13- * signature.
14- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@1d0bf38
13+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@1475116
1514 */
1615
1716 /* 4: return */
@@ -42,7 +41,7 @@ public class TestJavaClass021 {
4241 /*
4342 * 9: invokevirtual java/io/PrintStream#println(I)V TODO get args count
4443 * from signature.
45- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSRef@1ba0e0e
44+ * null#jp.igapyon.jcfa.vo.item.JcfaItemReference@11c8643
4645 */
4746
4847 /*
--- a/jcfa/testJavaClass/output/test/TestJavaClass031.jcfa
+++ b/jcfa/testJavaClass/output/test/TestJavaClass031.jcfa
@@ -10,8 +10,7 @@ public class TestJavaClass031 {
1010
1111 /*
1212 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
13- * signature.
14- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@181ab44
13+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@119510f
1514 */
1615
1716 /* 4: return */
--- a/jcfa/testJavaClass/output/test/TestJavaClass032.jcfa
+++ b/jcfa/testJavaClass/output/test/TestJavaClass032.jcfa
@@ -10,8 +10,7 @@ public class TestJavaClass032 {
1010
1111 /*
1212 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
13- * signature.
14- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@bc8928
13+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@f75278
1514 */
1615
1716 /* 4: return */
--- a/jcfa/testJavaClass/output/test/TestJavaClass041.jcfa
+++ b/jcfa/testJavaClass/output/test/TestJavaClass041.jcfa
@@ -10,8 +10,7 @@ public class TestJavaClass041 {
1010
1111 /*
1212 * 1: invokespecial java/lang/Object#<init>()V TODO get args count from
13- * signature.
14- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable@1e39a7c
13+ * signature. null#jp.igapyon.jcfa.vo.item.JcfaItemLocalVariable@1ba0e0e
1514 */
1615
1716 /* 4: return */
@@ -35,7 +34,7 @@ public class TestJavaClass041 {
3534 * 6: invokespecial
3635 * java/lang/IllegalArgumentException#<init>(Ljava/lang/String;)V TODO
3736 * get args count from signature.
38- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSString@1b34d17
37+ * null#jp.igapyon.jcfa.vo.item.JcfaItemReference@1f0d2a3
3938 */
4039
4140 /*
@@ -54,7 +53,7 @@ public class TestJavaClass041 {
5453 * 12: invokevirtual
5554 * java/lang/IllegalArgumentException#printStackTrace()V TODO get args
5655 * count from signature.
57- * null#jp.igapyon.jcfa.vo.operandstack.JcfaOSRef@8a43ba
56+ * null#jp.igapyon.jcfa.vo.item.JcfaItemReference@194e2e5
5857 */
5958
6059 /* 15: return */
Show on old repository browser