OSDN Git Service

save
authoriga <tosiki.iga@nifty.ne.jp>
Tue, 1 Apr 2014 12:29:26 +0000 (21:29 +0900)
committeriga <tosiki.iga@nifty.ne.jp>
Tue, 1 Apr 2014 12:29:26 +0000 (21:29 +0900)
jcfa/src/jp/igapyon/jcfa/JavaClassFileAnalyzer.java
jcfa/src/jp/igapyon/jcfa/util/JcfaWriteUtil.java
jcfa/src/jp/igapyon/jcfa/vo/JcfaMethod.java
jcfa/testJavaClass/output/test/TestJavaClass001.jcfa

index 1ae2884..3409906 100644 (file)
@@ -159,8 +159,9 @@ public class JavaClassFileAnalyzer {
 \r
                for (Type type : method.getArgumentTypes()) {\r
                        jcfaMethod.getComment().getCommentList().add(type.toString());\r
+                       jcfaMethod.getArugumentTypeList().add(type.toString());\r
                }\r
-               jcfaMethod.setType(method.getReturnType().getSignature());\r
+               jcfaMethod.setType(method.getReturnType().toString());\r
 \r
                final Code code = method.getCode();\r
                if (code == null) {\r
index 0917c22..b765466 100644 (file)
@@ -97,12 +97,24 @@ public class JcfaWriteUtil {
                writeToBuffer(jcfaMethod.getComment(), result);
 
                if (jcfaMethod.getName().equals("<init>")) {
-                       result.append("public " + jcfaClass.getLocalName() + "() {");
+                       result.append("public " + jcfaClass.getLocalName() + "(");
                } else {
                        result.append("public " + jcfaMethod.getType() + " "
-                                       + jcfaMethod.getName() + "() {");
+                                       + jcfaMethod.getName() + "(");
                }
 
+               int argNo = 0;
+               for (String argumentType : jcfaMethod.getArugumentTypeList()) {
+                       if (argNo != 0) {
+                               result.append(", ");
+                       }
+                       result.append(argumentType);
+                       result.append(" arg" + argNo);
+               }
+
+               result.append(")");
+
+               result.append("{");
                result.append("}");
        }
 
index 8e6b3e0..4b79bbe 100644 (file)
@@ -1,16 +1,25 @@
 package jp.igapyon.jcfa.vo;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class JcfaMethod extends JcfaNode {
        protected String name;
 
        protected String type;
 
+       protected final List<String> arugumentTypeList = new ArrayList<String>();;
+
        protected String access;
 
        public String getAccess() {
                return access;
        }
 
+       public List<String> getArugumentTypeList() {
+               return arugumentTypeList;
+       }
+
        public String getName() {
                return name;
        }
index c8fd808..58017e9 100644 (file)
@@ -9,6 +9,6 @@ public class TestJavaClass001 {
        /**
         * Method. java.lang.String[]
         */
-       public V main() {
+       public void main(java.lang.String[] arg0) {
        }
 }
\ No newline at end of file