-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Settings persistence does not work for inner-class hints #7077
Conversation
What happens in the problematic cases? This sounds like the problem lies deeper and should be fixed at the root. |
Settings persistence does not like keys with $ signs in them. Two hints (bugs.Unbalanced$Array and $Collection) were implemented via annotated inner classes and can't be disabled by the user since the FQN is used as key/id by default. This could be fixed by changing the hint id itself, or by changing the default id generator code. However a better option might be to encode the $ in AuxiliaryConfigBasedPreferencesProvider which is already encoding other chars.
you are right. I couldn't find it yesterday, but I did find it today. Enabling all tests since this would be in the project api itself. btw invalid keys will produce a warning:
here: netbeans/java/maven/src/org/netbeans/modules/maven/MavenProjectPropsImpl.java Lines 174 to 179 in 6a9d501
|
0167cc8
to
8107f06
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
Settings persistence does not like keys with
$
signs in them. Two hints (bugs.Unbalanced$Array
and$Collection
) were implemented via annotated inner classes and can't be disabled by the user since the FQN is used as key/id by default.Easiest fix seems to be to change the default id generation a bit and replace '$' with '_'. I am sure this could be also implemented somewhere later in the logic but I couldn't find the reason why the preference entry is quietly ignored, so I went for the easy option.However a better option might be to encode the
$
inAuxiliaryConfigBasedPreferencesProvider
which is already encodingother chars.
how to replicate:
project settings -> hints -> use project specific options
nb-configuration.xml