-
Notifications
You must be signed in to change notification settings - Fork 916
Add missing CopyableBuilder interfaces and fixed buggy ones. #3267
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
Conversation
builders.put(obj.getClassName(), obj); | ||
builderParents.put(obj.getClassName(), | ||
Stream.concat(Arrays.stream(parentInterfaces), Arrays.stream(obj.getSuperClasses())) | ||
.map(JavaClass::getClassName) | ||
.collect(Collectors.toSet())); |
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.
It looks like the same code will get executed for any matching i
. Is there a way to break it out of the loop?
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.
Nice catch, yes!
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.
Technically it might be slower this way with it outside of the loop, since most classes won't have a matching value and none will have multiple matching values (enforced in the interface visitation logic).
core/annotations/src/main/java/software/amazon/awssdk/annotations/ToBuilderIgnoreField.java
Show resolved
Hide resolved
core/auth/src/main/java/software/amazon/awssdk/auth/credentials/ProcessCredentialsProvider.java
Show resolved
Hide resolved
…ed when ToCopyableBuilder.toBuilder is invoked. Also fixed any violations that rule found.
e30f139
to
922ccc3
Compare
SonarCloud Quality Gate failed. |
…c36f85568 Pull request: release <- staging/317dd499-2aca-470a-9809-3e2c36f85568
Add CopyableBuilder and ToCopyableBuilder interfaces to credential providers. Also added spotbugs rule to validate that these and all other toBuilder methods are correct. Fixed any issues found with existing methods.