question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use JetBrains's Java annotations?

See original GitHub issue

https://github.com/JetBrains/java-annotations/

Annotations like @Contract and @Range look useful, especially for those who uses IntelliJ IDEA.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:24 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
trustincommented, Aug 4, 2021

@ikhoon Sounds good to me. We might want to introduce a new annotation that hides the direct reference to JetBrains’ @Nullable annotation, though:

@org.jetbrains.annotations.Nullable
...
public @interface NullableType {}

// in LoggingDecoratorBuilder:
... BiFunction<? super RequestContext, ? super Throwable, @NullableType ?> 
1reaction
ikhooncommented, Aug 5, 2021

Kotlin understands checkerframework’s Nullable, however, Kotlin compiler does not produce an error message. It only helps remove platform-types. https://kotlinlang.org/docs/java-interop.html#notation-for-platform-types Unfortunately, JSR-305 is the only annotation that can produce a compilation level error message with -Xjsr305=strict. https://kotlinlang.org/docs/java-interop.html#compiler-configuration

For better inter-ops with Kotlin, JSR-305 seems the best option at the moment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are JetBrains Annotations – and how to get them?
We can reference the JetBrains Annotations in two ways: by adding the official JetBrains.Annotations NuGet package to our project, or by adding ...
Read more >
JetBrains/java-annotations: Annotations for JVM ... - GitHub
A set of Java annotations which can be used in JVM-based languages. They serve as an additional documentation and can be interpreted by...
Read more >
org.jetbrains : annotations : 20.1.0 - Maven Central
JetBrains Java Annotations. A set of annotations used for code inspection support and code documentation. Licenses. The Apache Software License, Version ...
Read more >
org.jetbrains » annotations - Maven Repository
JetBrains Java Annotations. A set of annotations used for code inspection support and code documentation. License, Apache 2.0.
Read more >
It appears that JetBrains is abandoning compatibility with Java ...
It appears that JetBrains is abandoning compatibility with Java annotation processors ... I'm a Kotlin user who primarily uses it as a Java...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found