Hi,
could you please check again?
Am Sonntag, den 08.12.2019, 18:50 +0100 schrieb Martin Klähn:
>
> sorry, these warnings are still there.
> :(
>
I don't see this - this is my check (github/pr/1762 is your cleanup
branch, common_annotations_jsr305 is my fix for JSR305):
# Ensure master is current
git checkout master
git pull
# Create test branch
git checkout -b test_annotations
# Merge the api.search cleamup branch
git merge github/pr/1762
# Merge the common_annotations_jsr305 branch
git merge common_annotations_jsr305
# Ensure a clean build space
git clean -f -x -d
# Build complete code base
ant
# Clean platform/api.search
ant -f platform/api.search clean
# Build
ant -f platform/api.search
I see only one left over warning:
-do-compile:
[nb-javac] Compiling 122 source files to
/home/matthias/src/netbeans/platform/api.search/build/classes
[nb-javac] warning: No processor claimed any of these annotations:
org.netbeans.api.annotations.common.NullAllowed,org.netbeans.api.annotations.common.NonNull,org.netbeans.api.annotations.common.NullUnknown,org.netbeans.api.annotations.common.CheckForNull
[nb-javac] 1 warning
[copy] Copying 22 files to
/home/matthias/src/netbeans/platform/api.search/build/classes
To fix this, we either need to define an annotation processor handling
(or pretending handlig) the annotations. If I remember correctly the
annotations are only marker annotations, but I could be wrong. The
easier alternative I just tested:
Disable linting for annotation processing (I'm pondering whether or not
I find the warning helpful):
javac.compilerargs=-Xlint:all -Xlint:-serial -Xlint:-processing
With that building platform/api.search runs without warnings on OpenJDK
8.
Can you verify?
Greetings
Matthias
> On Sun, Dec 8, 2019 at 6:43 PM Matthias Bläsing <[email protected]>
> wrote:
>
> > Hi Martin,
> >
> > Am Sonntag, den 08.12.2019, 18:24 +0100 schrieb Martin Klähn:
> > > thanks for tackling this.
> > > Unfortunately this does not seem to solve the problem.
> > >
> > > If I build the Search API project (platform/api.search) on the current
> > > master branch I get 36 warnings. 33 of those are the reason for my
> > initial
> > > email.
> > > If I build the same project on your branch I get the same number of
> > > warnings.
> > > Any ideas?
> >
> > yes - the classes of the annotations need to be visible. The module
> > needs to export these packages therefore.
> >
> > I pushed an update to the branch, which adds exports for the JSR305
> > annotations.
> >
> > Please see if that helps.
> >
> > Matthias
> >
> >
> > > On Sun, Dec 8, 2019 at 5:28 PM Matthias Bläsing <
> > [email protected]>wrote:
> > > > Hi Martin,
> > > >
> > > > Am Sonntag, den 08.12.2019, 16:06 +0100 schrieb Martin Klähn:
> > > > > while working on fixing compiler warnings in several places I've come
> > > > along
> > > > > some warnings the compiler emitted while compiling the sources.
> > > > >
> > > > > A short example follows:
> > > > >
> > .../nbbuild/build/public-package-jars/org-netbeans-api-annotations-common.jar(/org/netbeans/api/annotations/common/NonNull.class):
> > > > > warning: Cannot find annotation method 'when()' in type 'Nonnull':
> > class
> > > > > file for javax.annotation.Nonnull not found
> > > > > warning: unknown enum constant When.ALWAYS
> > > > > reason: class file for javax.annotation.meta.When not found
> > > > >
> > .../nbbuild/build/public-package-jars/org-netbeans-api-annotations-common.jar(/org/netbeans/api/annotations/common/NullAllowed.class):
> > > > > warning: Cannot find annotation method 'when()' in type 'Nonnull'
> > > > > warning: unknown enum constant When.MAYBE
> > > > >
> > .../nbbuild/build/public-package-jars/org-netbeans-api-annotations-common.jar(/org/netbeans/api/annotations/common/CheckForNull.class):
> > > > > warning: Cannot find annotation method 'when()' in type 'Nonnull'
> > > > > warning: unknown enum constant When.MAYBE
> > > > >
> > .../nbbuild/build/public-package-jars/org-netbeans-api-annotations-common.jar(/org/netbeans/api/annotations/common/NullUnknown.class):
> > > > > warning: Cannot find annotation method 'when()' in type 'Nonnull'
> > > > > warning: unknown enum constant When.UNKNOWN
> > > > >
> > > > > These warning are annoying in so far as even if I manage to fix all
> > > > fixable
> > > > > warnings fixed - either by fixing the code or suppressing the warning
> > > > when
> > > > > appropriate - this leaves me with these warnings. This then also
> > prevents
> > > > > me from setting the -Werror compiler flag - which will ensure that
> > no new
> > > > > warning will leak into existing code.
> > > >
> > > > please check this:
> > > >
> > > >
> > https://github.com/matthiasblaesing/netbeans/tree/common_annotations_jsr305
> > > > from a quick test this works. I you agree with this fix we can
> > > > integrate it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists