3 Replies Latest reply on Dec 5, 2006 6:52 AM by Ben Catherall

    Injection of primitive with required=false

    Ben Catherall Newbie

      If the value to inject does not exist, Seam tries to set the primitive to null.

      A simple fix might be included in the Reflections.set method:

      public static void set(Field field, Object target, Object value) throws Exception
       {
       if (value == null && field.getClass().isPrimitive()) return;
      


      However, I suppose this does slightly change the injection semantics of stateful components - perhaps the field should be set to the default value for that primitive (i.e. false for boolean, zero for everything else).

      What do people think?