-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Avoid adding the same class to be validated multiple times #446
Conversation
@@ -109,34 +109,38 @@ public void build(ValidatorTemplate template, RecorderContext recorder, | |||
// Also consider elements that are marked with @ValidateOnExecution | |||
consideredAnnotations.add(VALIDATE_ON_EXECUTION); | |||
|
|||
Set<Class<?>> classesToBeValidated = new HashSet<>(); | |||
Set<String> classNamesToBeValidated = new HashSet<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@geoand good catch! Could you change it to use a set of DotName
? Looks better than using strings all over.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gsmet Of course, I'll fix that now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
d2ff6ca
to
2f63599
Compare
When using Bean Validation (which have to use the recorder.classProxy), it makes sense to create the initial set from the names of the classes that need to be validated and then create the class proxies. Doing it the other way around negates the use of the Set since each proxy is different even if the target class is the same
2f63599
to
a7cde11
Compare
I force pushed a minor formatting change to your branch. Merging now, thanks! |
@gsmet Cool, thanks! |
…o#446) Bumps [qute-core](https://github.com/quarkusio/quarkus) from 1.8.3.Final to 1.9.0.Final. - [Release notes](https://github.com/quarkusio/quarkus/releases) - [Commits](quarkusio/quarkus@1.8.3.Final...1.9.0.Final) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
When using Bean Validation (which have to use the recorder.classProxy),
it makes sense to create the initial set from the names of the classes
that need to be validated and then create the class proxies. Doing it
the other way around negates the use of the Set since each proxy is
different even if the target class is the same
What this PR prevents is the duplicate bytecode like the following (from the input-validation quickstart):