This bug was originally marked as duplicate of bug 190125, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.
Build: NetBeans IDE Dev (Build 201101280000)
VM: Java HotSpot(TM) 64-Bit Server VM, 19.0-b09, Java(TM) SE Runtime Environment, 1.6.0_23-b05
OS: Windows 7
narve: chose "Open" on a properties file. This was x_en_EN.properties, there were another x_no_NO.properties but no x.properties. Works fine for y.properties (in that case there are y.properties, y_en_EN and y_no_NO)
sunbiz: Opening new messages properties file is throwing this exception
GUEST: I was opening a properties file with the Open function
GUEST: When I wanted to open a properties file (context menu -> open) netbeans didn't open properties editor.
When I wanted to open this file using context menu -> edit netbeans has freezed, and I was force to terminate netbeans process. When beeing freezed netbeans didn't use more than 1% of processor time.
jonycus: trying to open i18n bundlefile
GUEST: "Open" on properties file (2 languages defined).
MrIncrdbl: Rechtsklick auf eine Ressourcen Datei messages.properties und
Created attachment 105431 [details]
Created attachment 106749 [details]
This bug already has 20 duplicates
Reproduced when Bundle.properties and Bundle_en_EN.properties exist and Open is invoked from the popup on Bundle_en_EN.properties.
MultiBundleStructure.findEntries() method fills "files" field with null because the interation through files in the folder does not find any matching fileobject and listFileObjects variable stays empty. The matching conditions need to be fixed.
Caused by file which uses any non-existing locale or country code. Properties support suppose all name comes from Locale.getISOLanguages() and Locale.getISOCountries(). That's reason why y_no_NO works but x_en_EN doesn't. The support behaves magically once using non-existing codes. The possible patch can fix this NPE but still needed to review the assumption above.
A hotfix applied by core-main/rev/a2254758bd9a
Still needed a better handling of cases of <file-name>_<existing-locale>_<non-existing-country-which-is-existing-locale>.properties
Integrated into 'main-golden', will be available in build *201103120400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Jiri Rechtacek <firstname.lastname@example.org>
Log: #194805: a hotfix of NPE at org.netbeans.modules.properties.PropertiesOpen.messageOpening
If this is planned to be fixed in 7.0, this bug should have the 70_HR_FIX_CANDIDATE keyword. If not, a waiver for 7.0 should be requested.
Marian, could someone from your team verify the fix? If so, I'm going to backport it into release70 quickly. Thanks
I tried to verify this bug:
*Create new j2se project 'MyProject' with main class in package 'a'
*Create new JFrame 'Frame' in MyProject in a
*Insert some JLabel and JButton into Frame
*In inspector on Form Frame node in properties (context menu on Form Frame node) check Automatic Internationalization -> Bundle.properties was created in package a
*Context menu on Bundle.properties. Add-> Locale. Create two new Locale:Bundle_en_EN.properties,Bundle_no_NO.properties in package a
*Invoke Open from context menu on all three *.properties files . EVERYTHING OK, NO EXCEPTION IS THROWN.
*Invoke Open from context menu on two rest *.properties files . EVERYTHING OK, NO EXCEPTION IS THROWN.
Jirka, please, does this usecase cover this bug completely???
Adam, thanks for your scenario. Could you try in with recent RC build? If this NPE is thrown in RC build but is not in recent dev build, we can rate it as verified. Make it verified in that case. Thank you
My scenario is OK.
I tested it on:
Product Version: NetBeans IDE 7.0 RC1 (Build 201103120000)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Linux version 2.6.32-29-generic running on i386; UTF-8; cs_CZ (nb)
the NullPointerException was thrown.
backport to NB70 - http://hg.netbeans.org/releases/rev/6ca4e053e271