But does removing the annotation really help? Won't it cause more warnings?
Generally, this is not a NetBeans annotation, it is a javac/JDK annotation
and is used by JDK. I guess the options I see are:
-update the annotations to RELEASE_8
-override the getSupportedSourceVersion() in all the annotation processors
to return javax.lang.model.SourceVersion.lastest(). (Which might mean the
processor will see source code model for new features and behave weird
without any warning whatsoever, but in most cases, this should be OK.)
-try something clever, like inferring the supported source version from the
source level of the module that contains the processor. Not sure if there's
some advantage to that, though.

Jan


On Wed, Jun 5, 2019 at 7:00 PM Brad Walker <bwal...@musings.com> wrote:

> I'm trying to clean up various build warnings.. I need some help/advice on
> one of them.
>
> In particular, we have 3160 cases of the following warning:
>
>    [repeat] warning: Supported source version 'RELEASE_7' from annotation
> processor '<java file location here>' less than -source '1.8'
>
> In looking at this in more detail, I noticed the following Annotation is
> causing this warning..
>
> @SupportedSourceVersion(SourceVersion.RELEASE_7)
>
> This annotation is in 70 different files.
>
> In looking at this closer, it really looks like we are not enforcing the
> use of this annotation. Also, we mandate Java 8 as the minimum supported
> release.
>
> So we either need to update all the files to at least
> SourceVersion.RELEASE_8. But, if we do this, this we will be back to having
> the same warning when compiling using a newer version of Java. Or we could
> just remove the annotation.
>
> My vote is for removing the annotation. It creates a LOT of warnings. The
> NetBeans sources has a lot of places where it completely ignores the
> annotation and just calls into library directly like this:
>
> if (javac.getSourceVersion().compareTo(SourceVersion.RELEASE_7) >= 0) {
>
> Before I put forth the effort to remove the annotation, I wanted to get a
> pulse from the group if this is the right course of action?
>
> I would appreciate any comments/insight that I might be missing..
>
> Thanks.
>
> -brad w.
>

Reply via email to