Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1532

onMessage checking is not correct

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • JBossAS-4.0.2RC1
    • JBossAS-3.2.7 Final, JBossAS-4.0.1 Final, JBossAS-4.0.1 SP1
    • JMS (JBossMQ)
    • None

      The checking of javax.jms.MessageListener.onMessage(javax.jms.Message) is not correct.
      1) It only applies to that interface
      2) It shoud only check for methods of that extact name/signature

      The current code is wrong in at least the following ways:
      1) It is checking any "onMessage" methods regardless of interface/signature
      Iterator it = getOnMessageMethods(bean);
      Method onMessage = (Method)it.next();

      if (!isPublic(onMessage))

      { fireSpecViolationEvent(mdBean, onMessage, new Section("15.7.4.b")); status = false; }

      if ( (isFinal(onMessage)) || (isStatic(onMessage)) )

      { fireSpecViolationEvent(mdBean, onMessage, new Section("15.7.4.c")); status = false; }

      etc.

      2) The method of testing for onMessage is not correct:

      /**

      • Check if the given message is the onMessage() method
        */
        public boolean isOnMessageMethod( Method m ) { return (m.getName().startsWith("onMessage")); }

              adrian.brock Adrian Brock (Inactive)
              adrian.brock Adrian Brock (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: