Bug 44194 - RadialGradientPaintContext: hints can be null
Summary: RadialGradientPaintContext: hints can be null
Status: NEW
Alias: None
Product: Batik - Now in Jira
Classification: Unclassified
Component: Utilities (show other bugs)
Version: 1.7
Hardware: Macintosh Mac OS X 10.4
: P1 critical
Target Milestone: ---
Assignee: Batik Developer's Mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-09 17:13 UTC by Dahai Li
Modified: 2008-01-10 11:56 UTC (History)
0 users



Attachments
The patch is to make sure variable "hints" is not null before being accessed in RadialGradientPaintContext. (369 bytes, patch)
2008-01-10 11:50 UTC, Dahai Li
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dahai Li 2008-01-09 17:13:40 UTC
On Mac OS 10.4.10 and 10.4.11, I see the following exception. The JVM passes the
parameter "hints" as null, RadialGradientPaintContext access it without checking
if it is null. 



Java Web Start 1.5.0
Using JRE version 1.5.0_13 Java HotSpot(TM) Client VM
User home directory = /Users/devtest
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
0-5: set trace level to <n>
----------------------------------------------------
DM Application Logging Started at Wed Jan 09 17:49:14 MST 2008
---------------------------------------------
Local DM Launcher Version = 1.5.23
Local DM Launcher Version Display = 1.5(23)
OK button clicked
Trying for ASDM Version file; url = https://171.69.39.36/admin/
Server DM Version = 6.1(0)29
Server DM Launcher Version = 1.5.23, size = 319488 bytes
invoking SGZ Loader..
Cache location = /Users/devtest/.asdm/cache
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at
org.apache.batik.ext.awt.RadialGradientPaintContext.<init>(RadialGradientPaintContext.java:177)
	at
org.apache.batik.ext.awt.RadialGradientPaint.createContext(RadialGradientPaint.java:464)
	at apple.awt.OSXSurfaceData.setupPaint(OSXSurfaceData.java:760)
	at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:1085)
	at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:1013)
	at apple.awt.OSXSurfaceData.drawfillShape(OSXSurfaceData.java:1346)
	at apple.awt.CRenderer.drawfillShape(CRenderer.java:536)
	at apple.awt.CRenderer.fill(CRenderer.java:574)
	at apple.awt.CRenderer.fill(CRenderer.java:561)
	at sun.java2d.pipe.ValidatePipe.fill(ValidatePipe.java:142)
	at sun.java2d.SunGraphics2D.fill(SunGraphics2D.java:2574)
	at
com.cisco.dmchart.gui.chart.FancyXYLineAndShapeRenderer.drawSecondaryPass(FancyXYLineAndShapeRenderer.java:244)
	at
com.cisco.dmchart.gui.chart.FancyXYLineAndShapeRenderer.drawItem(FancyXYLineAndShapeRenderer.java:156)
	at com.cisco.dmchart.gui.chart.FancyXYPlot.render(FancyXYPlot.java:101)
	at org.jfree.chart.plot.XYPlot.draw(XYPlot.java:2680)
	at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1214)
	at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1270)
	at javax.swing.JComponent.paint(JComponent.java:1006)
	at javax.swing.JComponent._paintImmediately(JComponent.java:4890)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4676)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:477)
	at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:114)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 Dahai Li 2008-01-10 11:50:15 UTC
Created attachment 21376 [details]
The patch is to make sure variable "hints" is not null before being accessed in RadialGradientPaintContext.
Comment 2 Dahai Li 2008-01-10 11:51:57 UTC
Comment on attachment 21376 [details]
The patch is to make sure variable "hints" is not null before being accessed in RadialGradientPaintContext.


The patch should be applied to 
RadialGradientPaintContext.java file.
Comment 3 Dahai Li 2008-01-10 11:54:33 UTC
Comment on attachment 21376 [details]
The patch is to make sure variable "hints" is not null before being accessed in RadialGradientPaintContext.


The patch should be applied to RadialGradientPaintContext.java .
Comment 4 Dahai Li 2008-01-10 11:56:01 UTC
Comment on attachment 21376 [details]
The patch is to make sure variable "hints" is not null before being accessed in RadialGradientPaintContext.


>176a177,185
>>         if (hints == null) {
>>           /**
>>            * It is observed that on Mac OS X 10.4.11 and JRE 1.5.0_13, this
>>            * constructor is called with hints == null.
>>            * See:
>>            * http://issues.apache.org/bugzilla/show_bug.cgi?id=44194
>>            */
>>           hints = new RenderingHints(null);
>>         }

The patch should be applied to
org.apache.batik.ext.awt.RadialGradientPaintContext file.