This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 252663 - can not compile a module without warnings using -source 8, from annotation processing
Summary: can not compile a module without warnings using -source 8, from annotation pr...
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Lookup (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-28 19:40 UTC by err
Modified: 2016-12-21 00:31 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description err 2015-05-28 19:40:52 UTC
Given a standalone module, under 8.0.2 or daily-builds, with a bundle and one source file:

    package stuff;

    import org.openide.util.Lookup;

    public class NewClass
    {
        void foo() {
            Object o = Lookup.getDefault().lookup(Object.class);
        }
    }


If I do clean&build I get
    warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than -source '1.8'
    warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source '1.8'
    2 warnings

Adding the -Werror option and then the build fails of course.
I am working on getting rid of all warnings and turning on the -Werror flag.

Adding the compiler option
    -Xlint:-processing
doesn't help. But this would only be a workaround anyway.

I couldn't find an option to disable this warning.

BTW, the code I'm working with is committed to JDK-1.8.
Comment 1 err 2015-05-28 19:48:15 UTC
BTW, there's Issue #210286 for the older problem with compiling with JDK-1.7
Comment 2 err 2015-05-28 19:56:09 UTC
Issue #210286 has some code for filtering out warnings. Anyone have a pointer handy to how to install/use it? (guess I'm feeling lazy) I don't suppose this will actually get rid of the warning (I still won't be able to turn on -Werror).
Comment 3 cezariusz 2015-05-29 05:05:31 UTC
In bug 248015 it has been fixed for PatchedPublicProcessor. The same fix should be applied to remaining processors. I was tired waiting for it or filing separate bugs for each module, so I did it by myself and I have rebuild my copy of platform from sources.
Comment 4 Tomas Hurka 2015-05-29 12:51:33 UTC
This has nothing to do with module system. This should be fixed in lookup module.
Comment 5 err 2015-05-29 15:38:38 UTC
@thurka

Take a look at the issue I mentioned,  Issue #210286 comment# 15. jtulach says
    ergonomics#c45f8d78f9da bumps supported versions of processors
    I could find to 7. I will not solve problems compiling on JDK8
    in this issue.
As you can see, the solution is to fix all the annotation processors throughout the system. I'm re-assigning to you, not because I believe it is your issue (it might be, I have no idea) but because my initial report did not sufficiently indicate the scope of the problem and it is not simply a lookup issue.


In my initial report, I just used a minimal example to show the *general* problem. Here's the output from one of my *real* modules. Of course, each module has a different list.



Compiling 40 source files to C:\a\src\wb-dev\wb\metawb\build\classes
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.api.annotations.common.proc.StaticResourceProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.projectapi.LookupProviderAnnotationProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.filesystems.declmime.MIMEResolverProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.NbBundleProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.loaders.DataObjectFactoryProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.templates.TemplateProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.awt.ActionProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.editor.mimelookup.CreateRegistrationProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.windows.TopComponentProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.nodes.NodesAnnotationProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.openide.modules.PatchedPublicProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.project.uiapi.CompositeCategoryProviderAnnotationProcessor' less than -source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor 'org.netbeans.modules.project.uiapi.NodeFactoryAnnotationProcessor' less than -source '1.8'
Comment 6 err 2015-05-29 15:50:25 UTC
I should have mentioned that the template for the fix now seems to be
in Bug 248015 from 6 months ago as @cezariusz mentioned in comment #3.
This keeps the annotation tracking, so that regular maintenance is not
required.

(not in issue Issue #210286 which is from a year ago)
Comment 7 Tomas Hurka 2015-06-12 16:32:56 UTC
(In reply to err from comment #5)
> @thurka
> 
> Take a look at the issue I mentioned,  Issue #210286 comment# 15. jtulach
> says
>     ergonomics#c45f8d78f9da bumps supported versions of processors
>     I could find to 7. I will not solve problems compiling on JDK8
>     in this issue.
> As you can see, the solution is to fix all the annotation processors
> throughout the system. I'm re-assigning to you, not because I believe it is
> your issue (it might be, I have no idea) but because my initial report did
> not sufficiently indicate the scope of the problem and it is not simply a
> lookup issue.
I am aware that this need to be fixed in all processors. This needs to be solved case by case - every owner of the annotation processors, should investigate if particular annotation processors works with JDK 8 or not. That's why I assigned it to the first module. After it is fixed in lookup, it can move to the next one and so on. Note that this issue probably will not get much attention until NetBeans build will be switched to JDK 8.

Reassigning back to lookup - this issue has nothing to do with Module System, once this is fixed, please assign to next module.
Comment 8 twifty 2016-12-21 00:31:57 UTC
More than a year later, is there any progress on this issue?