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

GH-2974 Add NonNullApi and NonNullFields to package-info.java in 'annotation' package #2974

Conversation

NathanQingyangXu
Copy link
Contributor

almost all of the nullness vulnerability has been fixed except that gigantic org.springframework.kafka.annotation.KafkaListenerAnnotationBeanPostProcessor class, which is left for future PR(s).

@NathanQingyangXu NathanQingyangXu changed the title add NonNullApi and NonNullFields to package-info.java in 'annotation'… GH-2974 Add NonNullApi and NonNullFields to package-info.java in 'annotation' package Dec 23, 2023
traverse = Objects.requireNonNullElseGet(
traverseResolved,
() -> !includes.isEmpty() || !excludes.isEmpty()
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the above change is suggested by IDEA. Let me know whether we are happy with the change and I can revert back to old state.

@@ -349,7 +363,8 @@ else if (resolved != null) {
private List<Class<? extends Throwable>> resolveClasses(Class<? extends Throwable>[] fromAnnot, String[] names,
String type) {

List<Class<? extends Throwable>> classes = new ArrayList<>(Arrays.asList(fromAnnot));
List<Class<? extends Throwable>> classes = new ArrayList<>(fromAnnot.length + names.length);
Collections.addAll(classes, fromAnnot);
Copy link
Contributor Author

@NathanQingyangXu NathanQingyangXu Dec 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the above changes tries to improve on:

  • code readability (the double list wrapper makes code reader's head spin a lot)
  • a little bit perf opt (super minor; JMH shows it boosts perf by 100%)

Again, let me know whether we need to do this in the first place

@NathanQingyangXu NathanQingyangXu force-pushed the add-nonnullapi-to-annotation-package branch from f197f47 to de1b435 Compare December 23, 2023 02:25
@NathanQingyangXu NathanQingyangXu force-pushed the add-nonnullapi-to-annotation-package branch from de1b435 to 57d8ec2 Compare December 23, 2023 02:44
@artembilan artembilan added this to the 3.1.2 milestone Jan 17, 2024
@artembilan artembilan merged commit 474651d into spring-projects:main Jan 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants