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 185522 - NullPointerException at org.netbeans.modules.apisupport.project.ui.branding.BasicBrandingModel.getKeyValue
Summary: NullPointerException at org.netbeans.modules.apisupport.project.ui.branding.B...
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
: 184305 185597 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-05-05 14:38 UTC by Jaroslav Tulach
Modified: 2010-05-10 09:13 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 169153


Attachments
stacktrace (3.40 KB, text/plain)
2010-05-05 14:38 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2010-05-05 14:38:15 UTC
Build: NetBeans IDE Dev (Build 100503-343fb0de9337)
VM: OpenJDK Client VM, 14.0-b16, OpenJDK Runtime Environment, 1.6.0_18-b18
OS: Linux

User Comments:
jtulach: Typed "LookAnd" in the branding dialog




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.apisupport.project.ui.branding.BasicBrandingModel.getKeyValue(BasicBrandingModel.java:673)
   at org.netbeans.modules.apisupport.project.ui.branding.ResourceBundleBrandingPanel.getKeyValue(ResourceBundleBrandingPanel.java:692)
   at org.netbeans.modules.apisupport.project.ui.branding.ResourceBundleBrandingPanel.access$1700(ResourceBundleBrandingPanel.java:96)
   at org.netbeans.modules.apisupport.project.ui.branding.ResourceBundleBrandingPanel$KeyNode.getDisplayName(ResourceBundleBrandingPanel.java:554)
   at org.netbeans.modules.apisupport.project.ui.branding.ResourceBundleBrandingPanel$BundleChildren.createNodes(ResourceBundleBrandingPanel.java:489)
   at org.netbeans.modules.apisupport.project.ui.branding.ResourceBundleBrandingPanel$BundleChildren.createNodes(ResourceBundleBrandingPanel.java:470)
Comment 1 Jaroslav Tulach 2010-05-05 14:38:20 UTC
Created attachment 98496 [details]
stacktrace
Comment 2 Antonin Nebuzelsky 2010-05-05 15:44:16 UTC
*** Bug 184305 has been marked as a duplicate of this bug. ***
Comment 3 Antonin Nebuzelsky 2010-05-06 12:36:37 UTC
ResourceBundleBrandingPanel and BrandingSupport do not operate on the same list of platform modules available for user branding.

1) BrandingSupport.getActivePlatform() contains a code which calls getPlatform() on the suite project but mistakenly does not return its result and always fallbacks to NbPlatform.getDefaultPlatform() - this means that if the suite project has a non-default platform active, RBBP operates on this non-default platform's modules but BrandingSupport still operates on modules of default platform

fixed in core-main #a7f57937eb5c

2) RBBP gets its list of module jars from LayerUtils.getPlatformJarsForSuiteComponentProject(suite) which includes also JARs of suite's module projects (see related issue #185519) and BrandingSupport operates only on list of platform modules. Possible changes:

a) I could either change RBBP to get its list the same way BrandingSupport does it

b) or LayerUtils.getPlatformJarsForSuiteComponentProject(suite) could be changed to return really only JARs of the suite's defined platform

Jesse, please comment on this. I think a) would be preferable here.

3) Jesse, also note what I noticed when a non-default platform is active for a suite project, LayerUtils.getPlatformJarsForSuiteComponentProject(suite) returns modules of *all* clusters, not only of those which are not excluded (for the default platform it does behave correctly and ignores excluded clusters) - but this will not be relevant to this bug if I fix 2) with a).
Comment 4 Antonin Nebuzelsky 2010-05-06 12:44:45 UTC
Well, I realized that BrandingSupport does not exclude clusters, so using its list as is for RBBP (option 2a) does not work.

Jesse, can 2b) and 3) be fixed in LayerUtils.getPlatformJarsForSuiteComponentProject?
Comment 5 Antonin Nebuzelsky 2010-05-06 12:52:09 UTC
Once more - I must have been wrong about 3) - now excluded clusters don't appear in RBBP for me even for non-default platform. Hmm.

So, what remains is 2b)... What do you think about it, Jesse?
Comment 6 Antonin Nebuzelsky 2010-05-06 14:44:00 UTC
*** Bug 185597 has been marked as a duplicate of this bug. ***
Comment 7 Jesse Glick 2010-05-06 14:46:54 UTC
(In reply to comment #3)
> RBBP gets its list of module jars from
> LayerUtils.getPlatformJarsForSuiteComponentProject(suite) which includes also
> JARs of suite's module projects
> 
> a) I could either change RBBP to get its list the same way BrandingSupport does
> it

Sounds right, but it depends on exactly what RBBP does with the result. Obviously it makes no sense to branding your own resources.

> b) or LayerUtils.getPlatformJarsForSuiteComponentProject(suite) could be
> changed to return really only JARs of the suite's defined platform

Do not do this.

(In reply to comment #4)
> I realized that BrandingSupport does not exclude clusters

So fix that.
Comment 8 Antonin Nebuzelsky 2010-05-07 11:47:15 UTC
>> I realized that BrandingSupport does not exclude clusters
>
> So fix that.

I decided to let BrandingSupport continue operating on the whole list of platform's modules, and instead fix this in RBBP by excluding modules which are not in BrandingSupport's list - i.e. for example suite's modules.

the second fix in core-main #e8c96391a007
Comment 9 Quality Engineering 2010-05-10 09:13:33 UTC
Integrated into 'main-golden', will be available in build *201005100200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log: