This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Small offer


I'd like to use some functionality. Does this patch have meaning?

$ diff -u Method.java.orig Method.java
--- Method.java.orig    2008-09-08 12:35:35 +0000
+++ Method.java 2008-12-16 15:32:35 +0000
@@ -232,19 +232,22 @@

String signature;

+  public static String makeSignature (Type arg_types[], Type return_type)
+  {
+    StringBuffer buf = new StringBuffer(100);
+    int args_count = arg_types.length;
+    buf.append('(');
+    for (int i = 0; i < args_count; i++)
+      buf.append (arg_types[i].getSignature());
+    buf.append(')');
+    buf.append(return_type.getSignature());
+    return buf.toString();
+  }
+
  public String getSignature ()
  {
    if (signature == null)
-      {
-       StringBuffer buf = new StringBuffer(100);
-       int args_count = arg_types.length;
-       buf.append('(');
-       for (int i = 0; i < args_count; i++)
-         buf.append (arg_types[i].getSignature());
-       buf.append(')');
-       buf.append(return_type.getSignature());
-       signature = buf.toString();
-      }
+      signature = makeSignature(arg_types, return_type);
    return signature;
  }



And maybe need to use StringBuilder?

Thanks!

--
WBR, Yaroslav Kavenchuk.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]