Bug 167511 - [Block]NPE when using customized IStyleProcessor with Chart Generator and no Chart will be rendered
Summary: [Block]NPE when using customized IStyleProcessor with Chart Generator and no ...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 2.2.0 M5   Edit
Assignee: David Michonneau CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-11 18:38 EST by Bianca Jiang CLA
Modified: 2007-02-04 13:20 EST (History)
4 users (show)

See Also:


Attachments
My SystemStyleProcessor.java (2.93 KB, text/java)
2007-01-03 12:15 EST, Bianca Jiang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bianca Jiang CLA 2006-12-11 18:38:14 EST
Use a customized IStyleProcessor with Generator.build() and the chart will not be rendered in UI.
Comment 1 David Michonneau CLA 2006-12-12 07:40:50 EST
Please post your implementation of IStyleProcessor an the stack trace of the NPE
Comment 2 Bianca Jiang CLA 2007-01-03 12:15:24 EST
Created attachment 56339 [details]
My SystemStyleProcessor.java

David, this is the problem that you have found: in IStyleProcessor.getStyle(Chart, StyledComponent) implementation, the passed in "StyledComponent" can be null which will throw a NPE and causing no chart rendered. I tried checking for null in my code but doesn't change anything. You mentioned you'll fix this so that no null StyledComponent is passed.

The stack trace I got:
java.lang.NullPointerException
	at org.eclipse.hyades.test.ui.forms.base.SystemStyleProcessor.getStyle(SystemStyleProcessor.java:36)
	at org.eclipse.birt.chart.factory.Generator.updateHierarchyStyle(Generator.java:405)
	at org.eclipse.birt.chart.factory.Generator.getMingledStyle(Generator.java:345)
	at org.eclipse.birt.chart.factory.Generator.applyStyles(Generator.java:270)
	at org.eclipse.birt.chart.factory.Generator.prepareComponent(Generator.java:177)
	at org.eclipse.birt.chart.factory.Generator.prepareComponent(Generator.java:186)
	at org.eclipse.birt.chart.factory.Generator.prepareStyles(Generator.java:155)
	at org.eclipse.birt.chart.factory.Generator.build(Generator.java:842)
Comment 3 Paul Slauenwhite CLA 2007-01-09 14:10:35 EST
David, when will 2.2.0 M5 ship?
Comment 4 Bianca Jiang CLA 2007-01-10 11:26:36 EST
David, I just tried my code with checking for null once again, this time restart eclipse after setting to High contrast mode and it works. So even StyledComponent sometimes is null, the chart can still be rendered. Thus I'm lowering this defect to normal and removing the dependency. Thanks.
Comment 5 David Michonneau CLA 2007-02-04 13:20:26 EST
fixed