This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

[FYI/JDWP] added method to Signature.java


I added a computeFieldSignature method to Signature.java. Well actually
Tromey gave me the single line of code which comprises of the method
body :)

Aaron

2005-07-07  Aaron Luchko  <aluchko@redhat.com>

        * gnu/classpath/jdwp/util/Signature.java
        (computeFieldSignature): New Method.


Index: gnu/classpath/jdwp/util/Signature.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/classpath/jdwp/util/Signature.java,v
retrieving revision 1.2
diff -u -p -r1.2 Signature.java
--- gnu/classpath/jdwp/util/Signature.java	2 Jul 2005 20:32:10 -0000	1.2
+++ gnu/classpath/jdwp/util/Signature.java	7 Jul 2005 22:54:17 -0000
@@ -39,6 +39,7 @@ exception statement from your version. *
 
 package gnu.classpath.jdwp.util;
 
+import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
 /**
@@ -64,6 +65,19 @@ public class Signature
   }
 
   /**
+   * Computes the field signature which is just the class signature of the
+   * field's type, ie a Field of type java.lang.String this will return
+   * "Ljava/lang/String;".
+   *
+   * @param field  the field for which to compute the signature
+   * @return       the field's type signature
+   */
+  public static String computeFieldSignature (Field field)
+  {
+    return computeClassSignature (field.getType());
+  }
+
+  /**
    * Computes the method signature, i.e., java.lang.String.split (String, int)
    * returns "(Ljava/lang/String;I)[Ljava/lang/String;"
    *

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