Announcement Announcement Module
Collapse
No announcement yet.
Issue in HippyMethodInvoker due to Enum with method? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue in HippyMethodInvoker due to Enum with method?

    Hi everybody!

    We use spring-batch to call our methods via Reflection.
    Our batch application (with spring-batch) uses the class AbstractMethodInvokingDelegator and the method invokeDelegateMethodWithArguments.

    For the most calls it worked fine.

    But in some cases wrong methods were called - here is an example:
    • method1: test1(String str1, Enum1 enum1)
    • method2: test1(String str1, Enum1 enum1, Enum2 enum2)
    1. the application should call the overloaded method2
    2. this works correct till the Enum2 hasn't got an method for a specific enum value
    3. if the Enum2 has got a method the argument looks like this "Enum2$1"
    4. this caused that the MethodInvoker didn't find the correct method
    5. the HippyMethodInvoker tried to find a matching method and calls method1 with only the first two parameters!

    From our understanding the HippyMethodInvoker should call method2 with all 3 parameters .

    Are we right?
    Is this an already reported issue and in which release it will be fixed?

    Or have we made a mistake?

    Regards,
    Steven

  • #2
    No idea anybody?
    Should I create a JIRA ticket for this bug?

    Regards,
    Steven

    Comment


    • #3
      Hi!

      In order to illustrate the "Enum with method"
      here's an example causing the issue:

      Code:
      public enum ProcStatus implements EnumConvertibleI<String> {
      
          NEW("NEW"), 
          ERR("ERR") { // common error 
      
              @Override
              public boolean isError() {
      
                  return true;
              }
          },
          ERR_XML("ERR_XML") { // xml validation error
      
              @Override
              public boolean isError() {
      
                  return true;
              }
          },
          ERR_TXT("ERR_TXT") { // txt processing error
      
              @Override
              public boolean isError() {
      
                  return true;
              }
          },
          ERR_HSH("ERR_HSH") {// duplicate hash value error
      
              @Override
              public boolean isError() {
      
                  return true;
              }
          },
          PRC("PRC"), // processed
          WIP("WIP"); // work in process
      
      
          private final String code;
      
          ProcStatus(String c) {
      
              code = c;
          }
      
          @Override
          public String code() {
      
              return code;
          }
      
          public boolean isError() {
      
              return false;
          }
      }
      Regards,
      Steven

      Comment

      Working...
      X