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

Stuck when drawing a specific stroke

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 7
    • client-libs
    • None
    • 2d
    • windows_7

      FULL PRODUCT VERSION :
      java version " 1.7.0_07 "
      Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
      Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [version 6.1.7601]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      tested on windows XP 32b / windows 7 64b with a 32b jdk

      A DESCRIPTION OF THE PROBLEM :
      With this stroke :
      Stroke dashedOutlineStroke = new BasicStroke(4f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1f, new float[]{4f,4f}, 0f);

      a call of
      g.drawLine(1657, -1657, -795817611, 117897492);
      will never return

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      call of drawLine shall not be blocked
      ACTUAL -
      call of drawLine never return

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      import java.awt.BasicStroke;
      import java.awt.Color;
      import java.awt.Component;
      import java.awt.Graphics;
      import java.awt.Graphics2D;
      import java.awt.Stroke;

      import javax.swing.JFrame;

      public class DrawLine extends Component {

      Stroke dashedOutlineStroke = new BasicStroke(4f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 1f, new float[]{4f,4f}, 0f);

      @Override
      public void paint(Graphics g){
      super.paint(g);
      Graphics2D g2d = (Graphics2D)g;
      g.setColor(Color.BLACK);
      g2d.setStroke(this.dashedOutlineStroke);

      System.err.println( " will stop after here " );
      g.drawLine(1657, -1657, -795817611, 117897492); // will stop here

      System.err.println( " never displayed " );
      g.drawRect(10, 10, 10, 10); // will never be displayed on screen
      }


      public static void main(String[] args) {
      JFrame frame = new JFrame( " " );
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.getContentPane().add(new DrawLine());
      frame.setSize(500,500);
      frame.setVisible(true);
      }
      }
      ---------- END SOURCE ----------

            flar Jim Graham
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: