• R/O
  • HTTP
  • SSH
  • HTTPS

jcfa: Commit

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


Commit MetaInfo

Revision46240110a1c9167e77f48ed566e25b425df093fa (tree)
Time2014-04-03 20:42:47
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
@@ -10,8 +10,8 @@ import jp.igapyon.jcfa.vo.JcfaCode;
1010 import jp.igapyon.jcfa.vo.JcfaComment;
1111 import jp.igapyon.jcfa.vo.JcfaField;
1212 import jp.igapyon.jcfa.vo.JcfaMethod;
13-import jp.igapyon.jcfa.vo.JcfaOperandStackNode;
1413 import jp.igapyon.jcfa.vo.JcfaUnit;
14+import jp.igapyon.jcfa.vo.operandstack.JcfaOSLocalVariable;
1515
1616 import org.apache.bcel.Constants;
1717 import org.apache.bcel.classfile.JavaClass;
@@ -138,14 +138,14 @@ public class JcfaWriteUtil {
138138
139139 switch (jcfaCode.getOpcode()) {
140140 case Constants.ALOAD_0: {
141- jcfaCode.getComment()
142- .getCommentList()
143- .add(jcfaMethod.getFrame().getLocalVariableList()
144- .get(0).getName());
145- final JcfaOperandStackNode operandStackNode = new JcfaOperandStackNode();
146- jcfaMethod.getFrame().getOperandStack().push(operandStackNode);
147- operandStackNode.setName(jcfaMethod.getFrame()
148- .getLocalVariableList().get(0).getName());
141+ final JcfaOSLocalVariable osLocalVariable = new JcfaOSLocalVariable();
142+ jcfaMethod.getFrame().getOperandStack().push(osLocalVariable);
143+ osLocalVariable.setLocalVariable(jcfaMethod.getFrame()
144+ .getLocalVariableList().get(0));
145+
146+ jcfaCode.getComment().getCommentList()
147+ .add(osLocalVariable.getLocalVariable().getName());
148+
149149 break;
150150 }
151151 case Constants.RETURN: {
--- a/jcfa/src/jp/igapyon/jcfa/vo/JcfaOperandStack.java
+++ b/jcfa/src/jp/igapyon/jcfa/vo/JcfaOperandStack.java
@@ -2,14 +2,16 @@ package jp.igapyon.jcfa.vo;
22
33 import java.util.Stack;
44
5+import jp.igapyon.jcfa.vo.operandstack.JcfaOSNode;
6+
57 public class JcfaOperandStack {
6- protected final Stack<JcfaOperandStackNode> operandStack = new Stack<JcfaOperandStackNode>();
8+ protected final Stack<JcfaOSNode> operandStack = new Stack<JcfaOSNode>();
79
8- public void push(final JcfaOperandStackNode operandStackNode) {
10+ public void push(final JcfaOSNode operandStackNode) {
911 operandStack.push(operandStackNode);
1012 }
1113
12- public JcfaOperandStackNode pop() {
14+ public JcfaOSNode pop() {
1315 return operandStack.pop();
1416 }
1517 }
--- a/jcfa/src/jp/igapyon/jcfa/vo/JcfaOperandStackNode.java
+++ /dev/null
@@ -1,13 +0,0 @@
1-package jp.igapyon.jcfa.vo;
2-
3-public class JcfaOperandStackNode {
4- protected String name;
5-
6- public String getName() {
7- return name;
8- }
9-
10- public void setName(String name) {
11- this.name = name;
12- }
13-}
--- /dev/null
+++ b/jcfa/src/jp/igapyon/jcfa/vo/operandstack/JcfaOSClass.java
@@ -0,0 +1,13 @@
1+package jp.igapyon.jcfa.vo.operandstack;
2+
3+public class JcfaOSClass 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+}
--- /dev/null
+++ b/jcfa/src/jp/igapyon/jcfa/vo/operandstack/JcfaOSLocalVariable.java
@@ -0,0 +1,15 @@
1+package jp.igapyon.jcfa.vo.operandstack;
2+
3+import jp.igapyon.jcfa.vo.JcfaLocalVariable;
4+
5+public class JcfaOSLocalVariable extends JcfaOSNode {
6+ protected JcfaLocalVariable localVariable;
7+
8+ public JcfaLocalVariable getLocalVariable() {
9+ return localVariable;
10+ }
11+
12+ public void setLocalVariable(JcfaLocalVariable localVariable) {
13+ this.localVariable = localVariable;
14+ }
15+}
--- /dev/null
+++ b/jcfa/src/jp/igapyon/jcfa/vo/operandstack/JcfaOSNode.java
@@ -0,0 +1,4 @@
1+package jp.igapyon.jcfa.vo.operandstack;
2+
3+public abstract class JcfaOSNode {
4+}
--- a/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaOperandStack.jcfa
+++ b/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/JcfaOperandStack.jcfa
@@ -39,9 +39,9 @@ public class JcfaOperandStack {
3939 }
4040
4141 /**
42- * Method. jp.igapyon.jcfa.vo.JcfaOperandStackNode
42+ * Method. jp.igapyon.jcfa.vo.operandstack.JcfaOSNode
4343 */
44- public void push(jp.igapyon.jcfa.vo.JcfaOperandStackNode arg0) {
44+ public void push(jp.igapyon.jcfa.vo.operandstack.JcfaOSNode arg0) {
4545 /*
4646 * 0: aload_0 this
4747 */
@@ -67,7 +67,7 @@ public class JcfaOperandStack {
6767 }
6868
6969 /** Method. */
70- public jp.igapyon.jcfa.vo.JcfaOperandStackNode pop() {
70+ public jp.igapyon.jcfa.vo.operandstack.JcfaOSNode pop() {
7171 /*
7272 * 0: aload_0 this
7373 */
--- /dev/null
+++ b/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/operandstack/JcfaOSClass.jcfa
@@ -0,0 +1,54 @@
1+package jp.igapyon.jcfa.vo.operandstack;
2+
3+/** TODO import func. is missing. */
4+public class JcfaOSClass extends jp.igapyon.jcfa.vo.operandstack.JcfaOSNode {
5+ /** */
6+ protected java.lang.String className;
7+
8+ /** Constructor. */
9+ public JcfaOSClass() {
10+ /*
11+ * 0: aload_0 this
12+ */
13+
14+ /*
15+ * 1: invokespecial jp/igapyon/jcfa/vo/operandstack/JcfaOSNode#<init>()V
16+ */
17+
18+ /* 4: return */
19+ }
20+
21+ /** Method. */
22+ public java.lang.String getClassName() {
23+ /*
24+ * 0: aload_0 this
25+ */
26+
27+ /*
28+ * 1: getfield TODO unsupported opcode
29+ */
30+
31+ /*
32+ * 4: areturn TODO unsupported opcode
33+ */
34+ }
35+
36+ /**
37+ * Method. java.lang.String
38+ */
39+ public void setClassName(java.lang.String arg0) {
40+ /*
41+ * 0: aload_0 this
42+ */
43+
44+ /*
45+ * 1: aload_1 TODO unsupported opcode
46+ */
47+
48+ /*
49+ * 2: putfield TODO unsupported opcode
50+ */
51+
52+ /* 5: return */
53+ }
54+}
\ No newline at end of file
--- /dev/null
+++ b/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/operandstack/JcfaOSLocalVariable.jcfa
@@ -0,0 +1,55 @@
1+package jp.igapyon.jcfa.vo.operandstack;
2+
3+/** TODO import func. is missing. */
4+public class JcfaOSLocalVariable extends
5+ jp.igapyon.jcfa.vo.operandstack.JcfaOSNode {
6+ /** */
7+ protected jp.igapyon.jcfa.vo.JcfaLocalVariable localVariable;
8+
9+ /** Constructor. */
10+ public JcfaOSLocalVariable() {
11+ /*
12+ * 0: aload_0 this
13+ */
14+
15+ /*
16+ * 1: invokespecial jp/igapyon/jcfa/vo/operandstack/JcfaOSNode#<init>()V
17+ */
18+
19+ /* 4: return */
20+ }
21+
22+ /** Method. */
23+ public jp.igapyon.jcfa.vo.JcfaLocalVariable getLocalVariable() {
24+ /*
25+ * 0: aload_0 this
26+ */
27+
28+ /*
29+ * 1: getfield TODO unsupported opcode
30+ */
31+
32+ /*
33+ * 4: areturn TODO unsupported opcode
34+ */
35+ }
36+
37+ /**
38+ * Method. jp.igapyon.jcfa.vo.JcfaLocalVariable
39+ */
40+ public void setLocalVariable(jp.igapyon.jcfa.vo.JcfaLocalVariable arg0) {
41+ /*
42+ * 0: aload_0 this
43+ */
44+
45+ /*
46+ * 1: aload_1 TODO unsupported opcode
47+ */
48+
49+ /*
50+ * 2: putfield TODO unsupported opcode
51+ */
52+
53+ /* 5: return */
54+ }
55+}
\ No newline at end of file
--- /dev/null
+++ b/jcfa/testJavaClass/output/jp/igapyon/jcfa/vo/operandstack/JcfaOSNode.jcfa
@@ -0,0 +1,17 @@
1+package jp.igapyon.jcfa.vo.operandstack;
2+
3+/** TODO import func. is missing. */
4+public class JcfaOSNode {
5+ /** Constructor. */
6+ public JcfaOSNode() {
7+ /*
8+ * 0: aload_0 this
9+ */
10+
11+ /*
12+ * 1: invokespecial java/lang/Object#<init>()V
13+ */
14+
15+ /* 4: return */
16+ }
17+}
\ No newline at end of file
Show on old repository browser