Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7153339

InternalError when drawLine with Xor and Antialiasing

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • Introduced In Build:
      b02
    • Introduced In Version:
      7u3
    • Resolved In Build:
      b58
    • CPU:
      generic, x86
    • OS:
      generic, windows_7
    • Verification:
      Verified

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.6.0_31"
        Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
        Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7601]

        A DESCRIPTION OF THE PROBLEM :
        java.lang.InternalError when first invoke "Graphics2D.drawLine" on mouseMoved. XorMode and Antialiasing enabled.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        no errors
        ACTUAL -
        exception on first drawLine

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        java.lang.InternalError: Unable to Stroke shape (attempt to validate Pipe with invalid SurfaceData)
        at sun.java2d.pipe.LoopPipe.getStrokeSpans(LoopPipe.java:282)
        at sun.java2d.pipe.LoopPipe.draw(LoopPipe.java:182)
        at sun.java2d.pipe.PixelToShapeConverter.drawLine(PixelToShapeConverter.java:34)
        at sun.java2d.pipe.ValidatePipe.drawLine(ValidatePipe.java:44)
        at sun.java2d.SunGraphics2D.drawLine(SunGraphics2D.java:2111)
        at TestX$MyComp.paintLine(TestX.java:44)
        at TestX$MyComp.mouseMoved(TestX.java:29)
        at java.awt.Component.processMouseMotionEvent(Component.java:6335)
        at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3285)
        at java.awt.Component.processEvent(Component.java:6059)
        at java.awt.Container.processEvent(Container.java:2039)
        at java.awt.Component.dispatchEventImpl(Component.java:4653)
        at java.awt.Container.dispatchEventImpl(Container.java:2097)
        at java.awt.Component.dispatchEvent(Component.java:4481)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4249)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
        at java.awt.Container.dispatchEventImpl(Container.java:2083)
        at java.awt.Window.dispatchEventImpl(Window.java:2482)
        at java.awt.Component.dispatchEvent(Component.java:4481)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:607)
        at java.awt.EventQueue$1.run(EventQueue.java:605)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
        at java.awt.EventQueue$2.run(EventQueue.java:621)
        at java.awt.EventQueue$2.run(EventQueue.java:619)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.awt.*;
        import java.awt.event.*;

        import javax.swing.*;

        public class TestX
        {
        public static void main(String[] args)
        {
        JFrame f = new JFrame();
        f.add(new MyComp());

        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setSize(500, 500);
        f.setLocationRelativeTo(null);
        f.setVisible(true);
        }

        private static class MyComp extends JLabel implements MouseMotionListener
        {
        public MyComp()
        {
        addMouseMotionListener(this);
        }

        @Override
        public void mouseMoved(MouseEvent e)
        {
        paintLine(getBackground(), (Graphics2D) getGraphics());
        }

        protected static void paintLine(Color bg, Graphics2D g2D)
        {
        g2D.setXORMode(bg);
        g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        int x1 = 100;
        int y1 = 100;
        int x2 = 200;
        int y2 = 200;

        try
        {
        g2D.drawLine(x1, y1, x2, y2);
        }
        catch (InternalError e)
        {
        e.printStackTrace();
        }
        }

        @Override
        public void mouseDragged(MouseEvent e)
        {
        }
        }
        }
        ---------- END SOURCE ----------

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                bagiras Oleg Pekhovskiy (Inactive)
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: