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.
Summary: | Adding warnings for misuse of the new literal underscores for primitive values | ||
---|---|---|---|
Product: | java | Reporter: | gliesian <gliesian> |
Component: | Hints | Assignee: | Svata Dedic <sdedic> |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.1.2 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
gliesian
2012-05-20 11:13:45 UTC
I may have made a mistake opening this... You may want to use the underscores for other reasons, such as credit cards... e.g., long creditCardNumber = 5555_5555_5555_5555; However, if you thing about it, a credit should probably be a string. This issue requires some thought before correcting. Here's another example that goes against my reasoning: int socialSecurityID = 111_11_1111; So far, there is only "Add Underscores" (Tools/Options/Editor/Hints/Language=Java/JDK 5 and later/Add Underscores) - disabled by default. But that pushes the same format to all literals, even those that do not have any underscores. It might be reasonable to add a warning in the future, that would only check consistency for literals which actually use underscores. |