Skip to content

Grid doesn't recognize valid property of bean ( example works with v24.7.1, fails with v24.9.13) #23943

@mdond

Description

@mdond

Description of the bug

vaadin flow 24.9.13:
in the attached example project the line
grid.addColumn("value");
throws an IllegalArgumentException: No property 'value' found in com.example.demo.MutableMeasurement

Expected behavior

e.g. vaadin flow 24.7.1:
the attached project works fine, grid.addColumn("value"); resolves correctly and the grid is shown.

This probably is related to changes made in context of #18524
resulting in this change #21770

When using BeanPropertySet.get(MutableMeasurement.class), the value property is not found because:
a. BeanUtil.internalGetBeanPropertyDescriptors() recursively walks interfaces - Measurement produces a descriptor with a read method, MutableMeasurement produces one with only a write method
b. The dedup logic in getBeanPropertyDescriptors() (line 88-91) replaces the read-method descriptor with the write-only one (both come from interfaces, so neither is preferred)
c. hasNonObjectReadMethod then filters out the write-only descriptor

Minimal reproducible example

vaadin-bug-demo.zip

Versions

  • Vaadin / Flow version: 24.9.13
  • Java version: 17
  • OS version: Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions