[java] Make default annotations context-dependent

Default annotation is now defined from PSI context using an ordered list of nullable or notnull annotations. The first available annotation is selected.
For Spring Boot 3, default annotation is org.springframework.lang.NonNull/Nullable
For Spring Boot 4, default annotation is org.jspecify.annotations.NonNull/Nullable
Legacy settings with an unordered annotation list are converted to make them ordered
Non-context-specific default annotations are still used as a default for external and inferred annotation; also it's a fallback option in contexts where no annotation is available at all
ChangeNullableDefaultsFix is removed, as now it's unlikely to produce the desired result (and probably was not useful before as well)
Fixes IDEA-372145 Support for third-party nullability providers

GitOrigin-RevId: 31794eb024ba310ca35d4b3df33420d0bb344898
This commit is contained in:
Tagir Valeev
2025-07-17 15:56:29 +00:00
committed by intellij-monorepo-bot
parent a63d0b7646
commit ac013e30b2
40 changed files with 573 additions and 460 deletions
@@ -1082,7 +1082,9 @@ node.call.hierarchy.unknown.jsp=unknown jsp
node.hierarchy.java.lang.object=All classes are derived from java.lang.Object
notification.navigation.to.overriding.classes=Navigation to overriding classes is not possible during index update
notification.navigation.to.overriding.methods=Navigation to overriding methods is not possible during index update
annotations.panel.title={0} annotations:
nullable.notnull.annotations.panel.title={0} annotations:
nullable.notnull.annotations.panel.description=The first from this list available in the project will be suggested as a quick-fix
nullable.notnull.annotations.runtime.instrumentation.tooltip=Add runtime assertions for notnull-annotated methods and parameters
nullable.notnull.configuration.dialog.title=Nullable/NotNull Configuration
nullable.notnull.annotation.used.label=Annotation used for code generation: