Uploaded image for project: 'Solder'
  1. Solder
  2. SOLDER-131

@Handles parameter should be permitted in any parameter position

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0.Beta1
    • Component/s: Core
    • Labels:
      None
    • Affects:
      Documentation (Ref Guide, User Guide, etc.), Interactive Demo/Tutorial
    • Estimated Difficulty:
      Medium

      Description

      To be consist with CDI observers, the @Handles parameter should be allowed to be used in any position in the list of method arguments. The only restriction is that there is exactly one parameter annotated with @Handles (and it must be of type CaughtException).

      Here is the relevant section on observer methods for reference:

      "10.4.2. Declaring an observer method

      An observer method may be declared by annotating a parameter @javax.enterprise.event.Observes. That parameter is the event parameter. The declared type of the parameter is the observed event type. If a method has more than one parameter annotated @Observes, the container automatically detects the problem and treats
      it as a definition error."

      So we should allow:

      public void handle(BeanManager, @Handles CaughtException<Exception> ex) {}

        Gliffy Diagrams

          Activity

          Hide
          lightguard Jason Porter added a comment -

          Fixed with GitHub rev b537274

          Show
          lightguard Jason Porter added a comment - Fixed with GitHub rev b537274
          Hide
          dan.j.allen Dan Allen added a comment -

          Great work! I love the tests! Keep them coming!

          Show
          dan.j.allen Dan Allen added a comment - Great work! I love the tests! Keep them coming!

            People

            • Assignee:
              lightguard Jason Porter
              Reporter:
              dan.j.allen Dan Allen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development