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

Infinite loop on drawing a polygon into an offscreen image graphics


    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
    • OS:


      Name: mc57594 Date: 12/05/99

      java version "1.2"
      Classic VM (build JDK-1.2-V, native threads)

      I submited last Friday a bug report(ID 98315) about java.awt.Polygon class.
        Today, i've received the answer about the bug, relating it with other bugs like
      4221516 and/or 4269933 or even 4221954 or 4194956. But these bugs are about
      problems with empty polygons.
      My test polygon is not empty and even have 11 points. The problem appears when
       i draw this polygon over a java.awt.Graphics class wich source is an offscreen
      image. In this last case, seem the processor enters in an infinite loop.
      This only take place with strange polygons as the one i submit after.

      I think you don't understood me( sorry, but my special english is not as good i
      i would desire). I think is a unreported bug. Try with the source code i
      submit. You can see that the same polygon not offers any problem with the
      Graphics object obtained from a Frame class, but with an offscreen Image taked
      as double buffer the polygon is not drawed.

      Here i copy the answer message you send me this morning. Includes the original
      message too.


      Please review the bugs below. It's not clear whether you have a new bug to
      report, or whether you're seeing a symptom of one of these still-open bugs.

      If you believe you have a new bug, after reporting these, please submit another
      report clarifying what new information is contained in your report.

      Best Regards,

      The bug you have reported is probably related to bugs including:

       4221516 and/or 4269933 or even 4221954 or 4194956

      Thank you for providing us with additional information
      that can be used in the resolution of this bug.

      This bug can be monitored via the the Java Developer
      Connection Bug Parade at:
      The Java Developer Connection is a free channel that is
      maintained by staff here at Sun. Access this web page to join:
      The home page for the JDC is:

      ----------------- Original Bug Report-------------------

      category : java
      subcategory : classes_awt
      type : bug
      synopsis : Infinite loop on drawing a polygon into an offscreen image graphics
      description : (is this a symptom of 4221516 and/or 4269933? or even 4221954? or

      java version "1.2"
      Classic VM (build JDK-1.2-V, native threads)

      1. The problem appears when draw an strange polygon into an offscreen image
      Seems the processor begin an infinite loop when executes the method of Graphics
      class drawPolygon(Polygon p)

      import java.awt.*;
      import java.awt.event.*;

      * Just a simple class that shows the paint problem
      * An offscreen image is used as double-buffer of screen.
      * When it tries to draw an special polygon into the offscreen image, unlike the
      * painting on screen, the processor begin an infinite loop, and runs, runs, and

      public class Bug extends Frame
        int npoints = 11;
        int xpoints[] =
        int ypoints[] =
        Polygon P = new Polygon(xpoints,ypoints,npoints);

        public Bug()
          Button bug_button = new Button("execute bug");
          bug_button.addActionListener(new ActionListener(){
             public void actionPerformed(ActionEvent e){


        * Good paint.
        * All works.
        public void paint(Graphics g)


        * Bad painting
        * Processor works, and works and works...
        public void paintOnBuffer()
          Image img = createImage(getWidth(),getHeight());
          Graphics img_graphics = img.getGraphics();



            //the conflic draw

        public static void main(String argv[]){
          Bug bug = new Bug();

      3. No error appears. I have waiting about 3-4 minutes.
      5. I have suffer it under windows nt on a 450Mhz 128Mb Intel Pentium 3 Machine
        My graphics card is also normal
      workaround : i have no one
      suggested_val :
      cust_name : Pedro Fernandez Bel
      cust_email : ###@###.###
      jdcid : PedroFernandezBel
      keyword : webbug
      company : Universidad de Zaragoza
      release : 1.2
      hardware : x86
      OSversion : win_nt_4.0
      priority : 4
      bugtraqID : 0
      dateCreated : 1999-11-26 08:04:55.0
      dateEvaluated : 1999-11-27 15:6:11
      (Review ID: 98365)


          Issue Links



              • Assignee:
                flar Jim Graham
                mchamnessunw Mark Chamness (Inactive)
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: