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 259079 - Support @SuppressWarnings("ConstantNamingConvention")
Summary: Support @SuppressWarnings("ConstantNamingConvention")
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-01 13:40 UTC by NukemBy
Modified: 2017-06-18 02:51 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NukemBy 2016-05-01 13:40:21 UTC
Under some conditions it is required to use name for constants that do not follow 'standard' naming convention. It would be nice to suppress such hints/warnings locally via @SuppressWarnings annotation, but it seems that NetBeans do not have support for suppressing of that particular warning:

From sources - attribute `suppressWarnings` is missing:
java.hints\src\org\netbeans\modules\java\hints\suggestions\ConstantNameHint.java 
    @Hint(
            id = ID,
            category = "naming",
            displayName = "#DN_ConstantNameHint",
            description = "#DESC_ConstantNameHint",
            customizerProvider=CPImpl.class
    )

Some list of codes already in use in other environments (e.g. IDEA) can be taken from here
https://jazzy.id.au/2008/10/30/list_of_suppresswarnings_arguments.html

   Constant naming convention	- ConstantNamingConvention

Also, currently it is really hard to learn which ID of the warning is to be used in particular case. It would be very handy to add display of that ID into Tools -> Options -> Editor -> Hint: Java
Comment 1 Radiodef 2017-06-18 02:51:51 UTC
This would be useful for annotation processing, because sometimes you want to generate code which definitely won't collide with what the user of the annotation processor has written.