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]

[RFA/JDWP] Fix ReferenceType.Methods for Interfaces


Currently, since the id is immediately cast into a ClassReferenceTypeId,
this method will fail for Interfaces.  This patch, which is already in
Classpath, fixes this by removing the cast and using a generic
RegerenceTypeId.  This allows Interface methods to be properly retrieved.

ChangeLog
2007-05-11  Kyle Galloway  <kgallowa@redhat.com>

    * classpath/gnu/classpath/jdwp/processor/ReferenceTypeId.java
    (executeMethods): Remove cast to ClassReferenceTypeId.

Questions/issues?

Thanks,
Kyle
Index: classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java
===================================================================
--- classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java	(revision 124570)
+++ classpath/gnu/classpath/jdwp/processor/ReferenceTypeCommandSet.java	(working copy)
@@ -183,8 +183,7 @@
   private void executeMethods(ByteBuffer bb, DataOutputStream os)
     throws JdwpException, IOException
   {
-    ClassReferenceTypeId refId
-      = (ClassReferenceTypeId) idMan.readReferenceTypeId(bb);
+    ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
     Class clazz = refId.getType();
 
     VMMethod[] methods = VMVirtualMachine.getAllClassMethods(clazz);

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