Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-608

Fix generics used within addObserverMethod

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Obsolete
    • Major
    • None
    • None
    • None
    • None

    Description

      the following code doesn’t compile:

      cdiEventEndpoints.values().stream().forEach(endpoint -> abd.addObserverMethod()
          .beanClass(CdiEventComponent.class)
          .observedType(endpoint.getType())
          .qualifiers(endpoint.getQualifiers())
          .notifyWith(endpoint::notify);
      

      I need to write:

      cdiEventEndpoints.values().stream().forEach(endpoint -> addCdiEventObserver(abd, endpoint));
      
      private <T> void addCdiEventObserver(AfterBeanDiscovery abd, CdiEventEndpoint<T> endpoint) {
          abd.<T>addObserverMethod()
              .beanClass(CdiEventComponent.class)
              .observedType(endpoint.getType())
              .qualifiers(endpoint.getQualifiers())
              .notifyWith(endpoint::notify);
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            meetoblivion_jira John Ament (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: