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.
Created attachment 150152 [details] editor screenshot How to reproduce: - Create a new managed bean using @ApplicationScope annotation - Declare a public constant inside the bean Unexepected result: - A warning message is shown "A managed bean with a public field ("FIELDNAME") should not declare any scope other than @Dependent" Expected result: - No error message, as CDI-Spec v1.2 states: <snip> 3.1. Managed beans ... If a managed bean has a _non-static public field_, it must have scope @Dependent. If a managed bean with a non-static public field declares any scope other than @Dependent, the container automatically detects the problem and treats it as a definition error. ... <snap>
in general constant is not the same as static, but I suppose you mean final static
(In reply to Sergey Petrov from comment #1) > in general constant is not the same as static, but I suppose you mean final > static Yes, I've meant "static final". Anyway if the public field is static no error message should be displayed.
Fixed in web-main 050336bc234d.
Integrated into 'main-silver', will be available in build *201506110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/050336bc234d User: Petr Hejl <phejl@netbeans.org> Log: #248245 - Unexpected warning message when using a public static field in a managed bean.