1 Reply Latest reply on Jan 24, 2010 7:16 AM by kabirkhan

    Qualifiers introduced a cleanup bug

    kabirkhan

      I've found that this code does no longer get called for the ContextualInjectionDependencyItem which are now created by AbstractInjectionValueMetaData

       

         private void removeClassContextReference()
         {
            DependencyInfo dependencyInfo = getDependencyInfo();
            if (dependencyInfo != null)
            {
               // remove all dependency items that hold class ref
               Set<DependencyItem> dependencys = dependencyInfo.getIDependOn(ClassContextDependencyItem.class);
               dependencys.addAll(dependencyInfo.getIDependOn(CallbackDependencyItem.class));
               for (DependencyItem di : dependencys)
               {
                  // can cast because of getIDepend method impl
                  ClassDependencyItem cdi = (ClassDependencyItem)di;
                  cdi.clear(getController());
               }
            }
         }
      

       

      https://jira.jboss.org/jira/browse/JBKERNEL-82

        • 1. Re: Qualifiers introduced a cleanup bug
          kabirkhan

          Fixed by introducing

           

          public interface ClearableDependencyItem
          {
             void clear(Controller controller);
          }
          

           

          and making ClassDependencyItem + ContextualInjectionDependencyItem implement that, and checking for ClearableDI instead in AbstractKernelControllerContext.removeClassContextReference()