Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-642

Method WebBeansUtil.configureProducerMethodSpecializations is unreliable

Bulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersConvert to sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment Visibility
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.3
    • 1.5.0
    • None
    • OWB trunk

    Description

      I have specialized producer method like this:

      @Produces @Specializes @MyConfigValue @Named
      public Boolean getProducerMethod()

      {....}

      Problem is that @Named is also at parent method -> exception "Specialized method getProducerMethod may not define @Named annotation"

      but this happens randomly once per 10 container starts or so.

      I tracked it down to:

      if (superMethod != null && superMethod.equals(pb.getCreatorMethod()))

      { producerBeanListHelper.add(pb); pLeft = (pb.isSpecializedBean()) ? pb : null; }

      else

      { pLeft = null; }

      When I comment out the pLeft = null; line OWB detect problem with @Named every time

      I guess that there are two or more problems together:

      1) client problem in my code : @Named at specialized method
      2) configureProducerMethodSpecializations is based on loop over BeanManagerImpl().getBeans(), which is set -> random order of ProducerMethodBean procesing
      3) bug in pLeft/pRight algorithm that clears pLeft with first unsuccessful method match, but pLeft/pRight are used for class equality, not method equality

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            markoc50 Martin Kočí
            markoc50 Martin Kočí
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment