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.
This issue was noticed by Edward Burns. From his mail: I recently had cause to use a CDI @ApplicationScoped managed bean in the course of implementing a new feature in JSF 2.2. After doing this, I now see that this bean is offered as a code-completion suggestion when filling out the EL in a JSF page! This bean should not be offered in code-completion. I expect that as more of our implementations take advantage of CDI, this might be a bigger problem than just this one case. A cheap fix, of course, would be to not offer beans with packages starting with "com.sun.faces", "org.glassfish" or "com.oracle" as code-completion suggestions.
Because this will impact any platform-provided code I think it deserves P2.
There are two ApplicationScoped annotations: javax.faces.bean.ApplicationScoped javax.enterprise.context.ApplicationScoped Which one do you mean ? Actually both shouldn't have no any relation to the managed beans autocompletion (which is actually is not CDI functionality). Autocompletion uses CDI as a model to get @Named CDI managed beans. It is just one source of data. There are number other sources for autocompletion, which I don't know. So the autocompletion issue is not CDI issue unless there is proof that CDI model returns wrong bean names. The presence of @ApplicationScoped annotation doesn't produce managed bean eligible for autocompletion. I've just check it. So the only way to get managed bean in autocompletion in respect of CDI source is add @javax.inject.Named annotation. In the latter case CDI model returns the bean as @Named bean. I don't see any reason to filter such beans based on package name or anything else. There is no any mentions about this in the CDI spec. So the issue looks like INVALID for me. I guess you have created your @ApplicationScoped along with @Named and faced to the issue. But this is not an issue. This is expected behavior. By the way NB Managed Bean wizard created @ApplicationScoped beans with @Named annotation. Just remove @Named if you don't want to have bean in the autocompletion. Otherwise please provide exact steps to reproduce the issue: how have you created @ApplicationScoped bean ? ( as I already said @ApplicationScoped annotation presence should not be a reason for autocompletion and this is an issue without need to restrict package names ).