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

Fix #21841 Setting non-integer value to a config bean attribute with @Min or @Max and without dataType=Integer.class locks the config bean #23693

Merged
merged 1 commit into from
Nov 2, 2021

Conversation

11rx4f
Copy link
Contributor

@11rx4f 11rx4f commented Nov 2, 2021

These properties are validated in JdbcConnectionPoolValidator$isValid() but the validation method calls Integer.parseInt() without checking the value type and throws NumberFormatException if the value is not Integer.
And, the caller org.jvnet.hk2.config.ConfigSupport$apply() does not catch the NumberFormatException in its own transaction.
That causes this issue.

On the other hand, org.glassfish.jdbc.config.JdbcConnectionPool has the annotation argument to avoid to set the invalid type value.
I think using this annotation argument is easer to deal with this issue.

Signed-off-by: 11rx4f ryosuke.okada@fujitsu.com

…ribute with @min or @max and without dataType=Integer.class locks the config bean

Signed-off-by: 11rx4f <ryosuke.okada@fujitsu.com>
@glassfish-bot
Copy link
Contributor

Can one of the admins verify this patch?

@hs536 hs536 added the bug Something isn't working label Nov 2, 2021
@arjantijms arjantijms merged commit 043df00 into eclipse-ee4j:master Nov 2, 2021
@arjantijms arjantijms added this to the 6.2.3 milestone Nov 2, 2021
@11rx4f 11rx4f deleted the 21841 branch December 20, 2021 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants