Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration property is not bound in a native image when property has get, set, and is methods #33232

Closed
philwebb opened this issue Nov 17, 2022 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@philwebb
Copy link
Member

BindableRuntimeHintsRegistrar currently uses BeanInfoFactory to get properties, I think we can safely switch to BeanUtils.getPropertyDescriptors which will be a little simpler and also make use of caches.

@philwebb philwebb added the type: task A general task label Nov 17, 2022
@philwebb philwebb self-assigned this Nov 17, 2022
@philwebb philwebb added this to the 3.0.x milestone Nov 17, 2022
@philwebb philwebb changed the title Swith BindableRuntimeHintsRegistrar to use BeanUtils.getPropertyDescriptors Switch BindableRuntimeHintsRegistrar to use BeanUtils.getPropertyDescriptors Nov 17, 2022
philwebb added a commit that referenced this issue Nov 17, 2022
Update `BindableRuntimeHintsRegistrar` to use
`BeanUtils.getPropertyDescriptors` rather than `BeanInfoFactory`.

Closes gh-33232
@snicoll snicoll modified the milestones: 3.0.x, 3.0.0 Nov 17, 2022
@wilkinsona wilkinsona changed the title Switch BindableRuntimeHintsRegistrar to use BeanUtils.getPropertyDescriptors Configuration property is not bound in a native image when property has get, set, and is methods Nov 17, 2022
@wilkinsona wilkinsona added type: bug A general bug and removed type: task A general task labels Nov 17, 2022
@wilkinsona
Copy link
Member

I've turned this into a bug as the change made has fixed the problem described in #33242 where no metadata was generated for a property with methods like these:

    public String getStatic() {
        return staticRegion;
    }

    public void setStatic(@Nullable String staticRegion) {
        this.staticRegion = staticRegion;
    }
    
    public boolean isStatic() {
    	return StringUtils.hasText(this.staticRegion);
    }

The isStatic method meant that no metadata was generated at all for the static property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants