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 - Incorrect warning about constant naming conventions
Summary: Incorrect warning about constant naming conventions
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Other
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-13 07:45 UTC by cezariusz
Modified: 2015-07-29 01:28 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Incorrect warning (9.19 KB, image/png)
2015-06-13 07:45 UTC, cezariusz
Details

Note You need to log in before you can comment on or make changes to this bug.
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.