JDK-6518385 : exception thrown from RescaleOp.filter(bimg, bimg)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-01-27
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b08Fixed
Related Reports
Relates :  
Description
The following exception is thrown from Java2Demo when you select "RescaleOp" from
the tab in the Images/ImageOps demo.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at sun.awt.image.SunWritableRaster.markDirty(SunWritableRaster.java:72)
        at sun.awt.image.ImagingLib.filter(ImagingLib.java:158)
        at java.awt.image.RescaleOp.filter(RescaleOp.java:482)
        at java.awt.image.RescaleOp.filter(RescaleOp.java:415)
        at java2d.demos.Images.ImageOps.render(ImageOps.java:146)
        at java2d.Surface.paint(Surface.java:361)
        at javax.swing.JComponent.paintChildren(JComponent.java:860)
        at javax.swing.JComponent.paint(JComponent.java:1032)
        at javax.swing.JComponent.paintChildren(JComponent.java:860)
        at javax.swing.JComponent.paint(JComponent.java:1032)
        at javax.swing.JComponent.paintChildren(JComponent.java:860)
        at javax.swing.JComponent.paint(JComponent.java:1032)
        at javax.swing.JComponent.paintChildren(JComponent.java:860)
        at javax.swing.JComponent.paint(JComponent.java:1032)
        at javax.swing.JComponent.paintChildren(JComponent.java:860)
        at javax.swing.JComponent.paint(JComponent.java:1032)
        at javax.swing.JComponent.paintChildren(JComponent.java:860)
        at javax.swing.JComponent.paint(JComponent.java:1032)
        at javax.swing.JComponent.paintChildren(JComponent.java:860)
        at javax.swing.JComponent.paint(JComponent.java:1032)
        at javax.swing.JComponent.paintChildren(JComponent.java:860)
        at javax.swing.JComponent.paint(JComponent.java:1032)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
        at javax.swing.JComponent.paintChildren(JComponent.java:860)
        at javax.swing.JComponent.paint(JComponent.java:1032)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5117)
        at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
        at javax.swing.JComponent._paintImmediately(JComponent.java:5065)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4875)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:723)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:595)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Comments
EVALUATION This was caused by the recent changes to DataBuffer tracking per bug 6205557. The code to mark a Raster dirty in ImagingLib was simplified and during the process an implicity check for null (via instanceof) was removed. Since ImagingLib uses a null return value to indicate "I could not perform the requested operation", as is the case with Rescale operations, a null check needs to be done before marking the returned raster dirty.
27-01-2007