Uploaded image for project: 'Commons Modeler'
  1. Commons Modeler
  2. MODELER-4

[modeler] Overloaded operations throw "wrong number of parameters" exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 2.0
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      34959

      Description

      If a model MBean has an overloaded operation (an operation with two or more
      signatures), only one of them can be successfully invoked at runtime. Invoking
      others will throw "Wrong number of parameters" exception.

      Here's what I've found out about the causing of the problem:

      Class org.apache.commons.modeler.BaseModelMBean internally stores and caches
      operations in a hashmap. The key to the hashmap is the operation name.
      Therefore, if an operation has multiple signatures, only one of them (the first
      one loaded) is stored in the hashmap. Invoking the same method with a different
      signature will cause "wrong number of parameters" exception.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              whu@sybase.com Joe Hu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: