Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
5.4.1
-
None
-
None
Description
If you create a BeanModel for a class with a private field that has the same name as a getter method, you end up with two properties:
package org.example; import java.util.Collections; import java.util.Locale; import org.apache.tapestry5.beaneditor.BeanModel; import org.apache.tapestry5.beaneditor.BeanModelSourceBuilder; import org.apache.tapestry5.internal.services.MapMessages; import org.apache.tapestry5.services.BeanModelSource; public class Foo { private boolean isBar; public boolean isBar() { return isBar; } public static void main(final String[] args) { BeanModelSource bms = new BeanModelSourceBuilder().build(); BeanModel<Foo> model = bms.createDisplayModel(Foo.class, new MapMessages(Locale.US, Collections.emptyMap())); System.out.println(model.getPropertyNames()); } }
The output is {{ [bar, isBar] }}
Attachments
Issue Links
- is broken by
-
TAP5-1064 Extend PropertyAccess to understand Scala style properties (which use a different naming convention than JavaBeans)
- Closed