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

fixed boolean getters recognition, improved performance #24

Merged
merged 1 commit into from
Mar 18, 2018
Merged

fixed boolean getters recognition, improved performance #24

merged 1 commit into from
Mar 18, 2018

Conversation

raipc
Copy link
Contributor

@raipc raipc commented Mar 18, 2018

By convention, accessors to boolean fields are generated with is prefix. If getter with get method is not found, try to find one with is prefix.

Some performance fix was made with assumption that most getters and setters have public visibility. In this case it is faster to call Class.getMethod method which searches for method defined in parent classes and works about 30 per cent faster (see the benchmark).
If number of methods defined in target class is small, it may be faster to call Class.getDeclaredMethods() and check method name and arguments (but I didn't implement this algorithm)

@virgo47 virgo47 merged commit 8cda90b into virgo47:version-4 Mar 18, 2018
@raipc raipc deleted the getter-fix branch March 19, 2018 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants