Attached is a patch file made with 'diff -up'.  I modified the class 
so that when jde-wiz-implement-interface is invoked, the default 
generated return statements return correct literals instead of simply 
null.  After using jde-wiz-implement-interface, the class should now 
save and compile without further work.


-----------------+---------------------------------------------------
Craig McGeachie  | #include <cheesy_tag.h>
+61 (410) 774902 | while (!inebriated) c2h5oh = (++bottle)->contents;
-----------------+---------------------------------------------------

--- MethodFactory.orig  Wed May 23 23:22:12 2001
+++ MethodFactory.java  Wed Jun 13 07:36:27 2001
@@ -158,6 +158,9 @@ public class MethodFactory
   }
 
 
+  private String[] numericTypesArray = 
+{"char","byte","short","int","long","float","double"};
+  private java.util.List numericTypesList = 
+java.util.Arrays.asList(numericTypesArray);
+
   public String getMethodSkeleton(Signature sig,
                                  boolean javadoc,
                                  boolean newline,
@@ -180,8 +183,13 @@ public class MethodFactory
     Method m = sig.getMethod();
     Class cl = m.getReturnType();
 
-    if (! cl.getName().equals("void"))
+    if (numericTypesList.contains(cl.getName())) {
+      res += "  return 0;\n";
+    } else if (cl.getName().equals("boolean")) {
+      res += "  return false;\n";
+    } else if (! cl.getName().equals("void")) {
       res += "  return null;\n";
+    }
 
     res += "}\n";
     return res;

Reply via email to