Bug 167511

Summary: [Block]NPE when using customized IStyleProcessor with Chart Generator and no Chart will be rendered
Product: z_Archived Reporter: Bianca Jiang <bjiang>
Component: BIRTAssignee: David Michonneau <dmichonneau>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: clin, dkhodges, paulslau, steven.wasleski
Version: 2.1.1   
Target Milestone: 2.2.0 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
My SystemStyleProcessor.java none

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