OSDN Git Service

save
[jcfa/jcfa.git] / jcfa / src / jp / igapyon / jcfa / util / JcfaWriteUtil.java
index d24d4a0..0917c22 100644 (file)
@@ -84,6 +84,13 @@ public class JcfaWriteUtil {
                result.append(";");
        }
 
+       /**
+        * Write method.
+        * 
+        * @param jcfaClass
+        * @param jcfaMethod
+        * @param result
+        */
        public static void writeToBuffer(final JcfaClass jcfaClass,
                        final JcfaMethod jcfaMethod, final StringBuffer result) {
 
@@ -92,12 +99,19 @@ public class JcfaWriteUtil {
                if (jcfaMethod.getName().equals("<init>")) {
                        result.append("public " + jcfaClass.getLocalName() + "() {");
                } else {
-                       result.append("public void " + jcfaMethod.getName() + "() {");
+                       result.append("public " + jcfaMethod.getType() + " "
+                                       + jcfaMethod.getName() + "() {");
                }
 
                result.append("}");
        }
 
+       /**
+        * Write comment.
+        * 
+        * @param jcfaComment
+        * @param result
+        */
        public static void writeToBuffer(final JcfaComment jcfaComment,
                        final StringBuffer result) {
                if (jcfaComment.isJavaDoc()) {
@@ -106,8 +120,16 @@ public class JcfaWriteUtil {
                        result.append("\n/* ");
                }
 
+               if (jcfaComment.getCommentList().size() > 1) {
+                       result.append("\n");
+               }
+
                for (String comment : jcfaComment.getCommentList()) {
-                       result.append(" " + comment + " ");
+                       if (jcfaComment.getCommentList().size() > 1) {
+                               result.append(" * " + comment + "\n");
+                       } else {
+                               result.append(comment);
+                       }
                }
 
                result.append(" */\n");