Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-817

MethodCall: match between formal parameters and actual arguments fails if an argument is a subtype of a parameter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.6.4, 2.7
    • None
    • None

      If we have class Foo with method:

      public class Foo {
      public void bar(Object a, String b) {}
      }

      then MethodCall fails if we invoke:

      dispatcher.callRemoteMethods(null, "bar", new Object[]

      {"hello", "world"}

      , new Class[]

      {String.class,String.class}

      , ...);

      because the first formal parameter of foo() is an Object and the arg a String, and we do an equals() on the 2 classes.

      Solution: use Class.isAssignableFrom(Class)

              rhn-engineering-bban Bela Ban
              rhn-engineering-bban Bela Ban
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: