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 262343

Summary: Preferences MAX_KEY_LENGHT no IllegalArgumentException is thrown no PreferenceChangeEvent is received
Product: platform Reporter: thomas_hopf
Component: Options&SettingsAssignee: Theofanis Oikonomou <theofanis>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.2   
Hardware: Other   
OS: Other   
Issue Type: DEFECT Exception Reporter:

Description thomas_hopf 2016-06-06 08:54:23 UTC
I have a question regarding Preferences MAX_KEY_LENGHT:

In my NBPreferences I store a Boolean value using putBoolean() with a Key that is more than 80 characters long.

All works ok! Key and value is written in the config file! No IllegalArgumentException is thrown!

 

The only problem is that no PreferenceChangeEvent is fired! When I reduce the key length to less than 80 characters then the PreferenceChangeEvent is fired!

What is wrong? In the java API of Preferences it is written that IllegalArgumentException is fired - if key.length() exceeds MAX_KEY_LENGTH.

 

Is NBPreferences somehow suppressing the IllegalArgumentException?

What could be done to support firing PreferenceChangeEvent when keys have more than 80 characters?