Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-861

Be Kotlin-friendly by adding Nonnull annotations to all public API interfaces (such as Solver)

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Won't Do
    • Icon: Major Major
    • 7.3.0.Final
    • 7.2.0.Final
    • optaplanner-core
    • 2020 Week 19-21 (from May 4)
    • 5
    • NEW
    • NEW

      Suggestion by a customer, but in practice we cannot do it easily do to the lack of a standard Nonnull annotation. These are the ones that Kotlin detects:

      • JetBrains (@Nullable and @NotNull from the org.jetbrains.annotations package)
      • Android (com.android.annotations and android.support.annotations)
      • JSR-305 (javax.annotation) // DEAD!
      • FindBugs (edu.umd.cs.findbugs.annotations)
      • Eclipse (org.eclipse.jdt.annotation)
      • Lombok (lombok.NonNull).

      None of these are reliable and standard enough to be used everywhere in our API's.
      https://kotlinlang.org/docs/reference/java-interop.html#nullability-annotations

      org.reflections:reflections does drag in com.google.code.findbugs:annotations, which contains javax.annotation.Nonnull, but it shouldn't do that and java 9 jigsaw will have a problem with that because it's a split package (which is illegal for module-info.java IIRC).

            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: