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 252965

Summary: Incorrect warning about constant naming conventions
Product: java Reporter: cezariusz <cezariusz>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: VERIFIED FIXED    
Severity: normal CC: cezariusz
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Other   
Issue Type: DEFECT Exception Reporter:
Attachments: Incorrect warning

Description cezariusz 2015-06-13 07:45:17 UTC
Created attachment 154191 [details]
Incorrect warning

Product Version: NetBeans IDE Dev (Build 201506070001)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b15
System: Windows 8 version 6.2 running on amd64; Cp1250; pl_PL (nb)

A variable which is static final is not always a constant:
http://stackoverflow.com/questions/1417190/should-a-static-final-logger-be-declared-in-upper-case
https://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s5.2.4-constant-names

When preparing this report I've found out that there is an option to check only immutable types, and it seems to work well with my code, although the description is a little bit misleading (it doesn't consider only certain predefined JDK classes as immutable). Also note a spelling error in the description (certan -> certain).

I believe that at least the immutable option should be checked by default.
Comment 1 Svata Dedic 2015-07-24 12:42:03 UTC
Fixed in jet-main#ba63be1e0997.

There's a 'check only immutables' option, now on by default. Some immutable classes from JDK are hardcoded, others can be configured for the hint.
Comment 2 cezariusz 2015-07-27 08:45:44 UTC
Verified with Build 201507240001.
Comment 3 Quality Engineering 2015-07-29 01:28:28 UTC
Integrated into 'main-silver', will be available in build *201507290002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ba63be1e0997
User: Svata Dedic <sdedic@netbeans.org>
Log: #253096, #252965: adjusted default pattern. Enabled only immutable checking by default.