I have the classes PrimitiveProperty and ComplexProperty and the Property interface. I want to create a property implementation that forces an empty, unmodifiable set of instances of Property as the return value of Property.getProperties , for example.
public interface Property { Set<Property> getProperties(); } public class ComplexProperty implements Property { private Set<Property> properties;
With Glassfish 4.0 and I get
java.lang.IllegalAccessException: class javax.el.ELUtil cannot access a member of class java.util.Collections $ UnmodifiableCollection with "public" modifiers
when I access a property in the leaf Richfaces tree attribute, for example.
<r:tree id="aTree" toggleType="ajax" var="item" > <r:treeModelRecursiveAdaptor roots="#{aCtrl.roots}" nodes="#{item.properties}" leaf="#{item.properties.isEmpty()}"> <r:treeNode> #{item.name} </r:treeNode> <r:treeModelAdaptor nodes="#{item.properties}" leaf="#{item.properties.isEmpty()}"/> </r:treeModelRecursiveAdaptor> </r:tree>
The problem disappears if I change the constant EMPTY_PROPS constant (assigning an instance of HashSet instead of the return value of Collections.unmodifiableSet ), which is not my intention.
Is it possible to achieve what I want to do? Should I invent or use an implementation of what Collections$UnmodifiableCollection (subclasses) do that are compatible with JSF access needs?
el jsf-2
Karl Richter
source share