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 194805 - [70cat] NullPointerException at org.netbeans.modules.properties.PropertiesOpen.messageOpening
Summary: [70cat] NullPointerException at org.netbeans.modules.properties.PropertiesOpe...
Status: VERIFIED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Properties (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-28 12:18 UTC by narve
Modified: 2011-03-17 14:18 UTC (History)
11 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 176235


Attachments
stacktrace (3.16 KB, text/plain)
2011-01-28 12:18 UTC, narve
Details
stacktrace (3.23 KB, text/plain)
2011-03-05 16:46 UTC, host
Details

Note You need to log in before you can comment on or make changes to this bug.
Description narve 2011-01-28 12:18:43 UTC
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

User Comments:
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 
Comment 1 narve 2011-01-28 12:18:53 UTC
Created attachment 105431 [details]
stacktrace
Comment 2 host 2011-03-05 16:46:24 UTC
Created attachment 106749 [details]
stacktrace
Comment 3 Exceptions Reporter 2011-03-05 16:46:36 UTC
This bug already has 20 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=176235
Comment 4 Antonin Nebuzelsky 2011-03-11 14:11:49 UTC
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.
Comment 5 Jiri Rechtacek 2011-03-11 16:17:02 UTC
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.
Comment 6 Jiri Rechtacek 2011-03-11 17:09:29 UTC
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
Comment 7 Quality Engineering 2011-03-12 09:44:13 UTC
Integrated into 'main-golden', will be available in build *201103120400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/a2254758bd9a
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #194805: a hotfix of NPE at org.netbeans.modules.properties.PropertiesOpen.messageOpening
Comment 8 Petr Jiricka 2011-03-16 12:47:16 UTC
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.
Comment 9 Jiri Rechtacek 2011-03-16 13:38:33 UTC
Marian, could someone from your team verify the fix? If so, I'm going to backport it into release70 quickly. Thanks
Comment 10 asenk 2011-03-16 15:11:43 UTC
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.
*Delete Bundle.properties
*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???
Comment 11 Jiri Rechtacek 2011-03-16 19:10:06 UTC
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
Comment 12 asenk 2011-03-16 20:45:29 UTC
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.

So verified.
Comment 13 Jiri Rechtacek 2011-03-17 14:18:35 UTC
backport to NB70 - http://hg.netbeans.org/releases/rev/6ca4e053e271