Reduce use of javax.annotation annotations 32/76732/21
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 8 Oct 2018 09:12:50 +0000 (11:12 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 31 Oct 2018 10:04:43 +0000 (11:04 +0100)
commit33a2ceeb29e15d57fb193ee8214cfb98008340b7
tree65932a30919563db7f39b5d0e46ea52b2fad421e
parentfa49cff3709ce3bb64f0d4c473af477431d10cf0
Reduce use of javax.annotation annotations

The annotations in use have runtime retention, which triggers
generation of import-package for javax.annotation, which is no longer
satisfied with newer JDKs.

Use JDT @Nullable annotation instead. Since @Nullable is TYPE_USE
annotation, this also requires a bit of juggling in JavaFileTemplate
to make it work correctly with types which end up being referenced
via their FQCN.

This still retains javax.annotation.CheckReturnValue, but marks it
for replacement once we decide where to go annotation-wise.

JIRA: MDSAL-372
Change-Id: I792094d3c07162a5f8e6ca82ceea3a75b48c7b6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator-impl/src/main/java/org/opendaylight/mdsal/binding/generator/impl/AbstractTypeGenerator.java
binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/AbstractJavaGeneratedType.java
binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/InterfaceTemplate.xtend
binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/JavaFileTemplate.java
binding/mdsal-binding-java-api-generator/src/test/java/org/opendaylight/mdsal/binding/java/api/generator/test/CompilationTest.java