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 249869 - Lookup cannot find classes in methods.
Summary: Lookup cannot find classes in methods.
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Lookup (show other bugs)
Version: 8.0.2
Hardware: All All
: P4 normal (vote)
Assignee: Jaroslav Havlin
Depends on:
Reported: 2015-01-17 00:06 UTC by SirIntellegence
Modified: 2015-03-04 15:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

Example Project (13.07 KB, application/zip)
2015-01-17 00:06 UTC, SirIntellegence

Note You need to log in before you can comment on or make changes to this bug.
Description SirIntellegence 2015-01-17 00:06:50 UTC
Created attachment 151553 [details]
Example Project

Given the attached project, When the installer in Killer1 restores, it only finds one Provider for the interface Installer.Foo instead of the expected 2 with the annotation, one of them is in a method. I think that either:
a. It should work or
b. The annotation processor of ServiceProvider should raise a compile error if the class in question is in a method or otherwise inaccessible.
Just my 10ยข.
Comment 1 Jaroslav Havlin 2015-03-04 15:03:09 UTC
I'm sorry, annotation of the local (nested in method) class is not processed by annotation processors, i.e. it is not contained in the set returned from RoundEnvironment.getElementsAnnotatedWith(ServiceProvider.class), so it's not easy to detect that it is used incorrectly.

I'm not sure this can be fixed in the near future.
Thank you for reporting.