Hi to all,

in Seam2, using injected member within final method will cause an NPE at Runtime. The reason for that is, that Seam2 uses cglib for dynamic proxying und subclassing is not possible for final methods.

Example:
@Name("simpleSeamComp")
public class SimpleSeamComponent {
    public String getName() {
        return "Sam";
    }
}

@Name("finalSeamComp")
public class FinalSeamComponent {

    @In(create = true)
    private SimpleSeamComponent simpleSeamComp;

    // causes NullPointerException
    public final String getHello() {
        return simpleSeamComp.getName();
    }
}


How will Seam3/CDI behave in that case?



Thanks and regards
Michael