[ 
https://issues.apache.org/jira/browse/NETBEANS-3380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16978064#comment-16978064
 ] 

Ernie Rael edited comment on NETBEANS-3380 at 11/20/19 4:59 AM:
----------------------------------------------------------------

Here's the entire trivial change in file 
.../java/hints/suggestions/ConstantNameHint.java
old:  boolean onlyImmClasses = prefs.getBoolean(PREF_CHECK_ONLY_IMMUTABLES, 
false);
new: boolean onlyImmClasses = prefs.getBoolean(PREF_CHECK_ONLY_IMMUTABLES, 
DEFAULT_CHECK_ONLY_IMMUTABLES);

Use the constant (which is defined to be "true") instead of primitive "false". 
This avoid inconsistencies between ui display and actual behavior. The ui uses 
the constant.


was (Author: errael):
Here's the entire trivial change in file 
.../java/hints/suggestions/ConstantNameHint.java

- boolean onlyImmClasses = prefs.getBoolean(PREF_CHECK_ONLY_IMMUTABLES, false);
+ boolean onlyImmClasses = prefs.getBoolean(PREF_CHECK_ONLY_IMMUTABLES, 
DEFAULT_CHECK_ONLY_IMMUTABLES);

Use the constant (which is defined to be "true") instead of primitive "false". 
This avoid inconsistencies between ui display and actual behavior. The ui uses 
the constant.

> "ConstantName" hint's flag "Check only immutable" uses incorrect default
> ------------------------------------------------------------------------
>
>                 Key: NETBEANS-3380
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-3380
>             Project: NetBeans
>          Issue Type: Bug
>          Components: java - Hints
>    Affects Versions: 11.2
>         Environment: windows, jdk1.8
>            Reporter: Ernie Rael
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: ConstantNameHint.java.diff
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> For the indicated option, "prefs.getBoolean(str, default)" has different 
> "default" for when displaying the options dialog and checking value for use. 
> *FIX ATTACHED* for ConstantNameHint.java (haven't learned git yet...)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to