@Nullable/@NotNull with IntelliJ IDEA, Maven & JSR 305

前端 未结 4 642
闹比i
闹比i 2020-12-29 09:52

I really like the code inspection functionalities which are now able with either JSR 305 or Jetbrains\' proprietary annotations for IntelliJ. Unfortunately both implementati

4条回答
  •  青春惊慌失措
    2020-12-29 10:21

    I'm late to the party, but for future readers this might be interesting.

    As of IntelliJ 15.0.2, you may natively use other annotations than the JetBrains ones:

    • go to the settings
    • go to the Editor > Inspections tab
    • go to Java > Probable Bugs > "@NotNull/@Nullable problems"
    • at the end of the options panel (you might need to scroll), there is a Configure annotations button, leading to this dialog where you can select from a list of well-known annotations:

提交回复
热议问题