[jboss-user] [JBoss Seam] - Injection of primitive with required=false

dilator do-not-reply at jboss.com
Sun Dec 3 10:34:13 EST 2006


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?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990808#3990808

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990808



More information about the jboss-user mailing list