java.lang.InternalError: Unable to Stroke shape (null)

Coderanch | Joshua Antony | 10 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Exception in thread "AWT-EventQueue-0" java.lang.InternalError: Unable to Stroke shap

    Coderanch | 10 years ago | Joshua Antony
    java.lang.InternalError: Unable to Stroke shape (null)
  2. 0

    java.lang.InternalError: Unable to Stroke shape () in 1.5.0_01

    Oracle Community | 1 decade ago | 843811
    java.lang.InternalError: Unable to Stroke shape ()
  3. 0

    unable to stroke shape ???

    Oracle Community | 1 decade ago | 843799
    java.lang.InternalError: Unable to Stroke shape (setPenT4: invalid pen transformation (singular))
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    FULL PRODUCT VERSION : openjdk version "1.8.0_40-internal" OpenJDK Runtime Environment (build 1.8.0_40-internal-b04) OpenJDK 64-Bit Server VM (build 25.40-b08, mixed mode) ADDITIONAL OS VERSION INFORMATION : Linux znf274 3.7.0-999-generic #201211070425 SMP Wed Nov 7 09:25:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux A DESCRIPTION OF THE PROBLEM : Graphics2D.draw(Shape) throws java.lang.InternalError for some shapes caused by ArrayIndexOutOfBoundsException at sun.java2d.pisces.Dasher.goTo() REGRESSION. Last worked in version 6u45 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : javac Test2.java java Test2 EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Normal exit ACTUAL - throws exception ERROR MESSAGES/STACK TRACES THAT OCCUR : Exception in thread "main" java.lang.InternalError: Unable to Stroke shape (null) at sun.java2d.pipe.LoopPipe.getStrokeSpans(LoopPipe.java:285) at sun.java2d.pipe.LoopPipe.draw(LoopPipe.java:201) at sun.java2d.pipe.PixelToParallelogramConverter.draw(PixelToParallelogramConverter.java:148) at sun.java2d.pipe.ValidatePipe.draw(ValidatePipe.java:154) at sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2497) at Test2.main(Test2.java:33) Caused by: java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at sun.java2d.pisces.Dasher.goTo(Dasher.java:151) at sun.java2d.pisces.Dasher.somethingTo(Dasher.java:244) at sun.java2d.pisces.Dasher.quadTo(Dasher.java:548) at sun.java2d.pipe.RenderingEngine.feedConsumer(RenderingEngine.java:369) at sun.java2d.pisces.PiscesRenderingEngine.pathTo(PiscesRenderingEngine.java:484) at sun.java2d.pisces.PiscesRenderingEngine.strokeTo(PiscesRenderingEngine.java:363) at sun.java2d.pisces.PiscesRenderingEngine.strokeTo(PiscesRenderingEngine.java:163) at sun.java2d.pisces.PiscesRenderingEngine.strokeTo(PiscesRenderingEngine.java:142) at sun.java2d.pipe.LoopPipe.getStrokeSpans(LoopPipe.java:278) ... 5 more REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; import java.awt.Stroke; import java.awt.geom.GeneralPath; import java.awt.image.BufferedImage; public class Test2 { public static void main(String[] args) { GeneralPath shape = new GeneralPath(); int[] pointTypes = {0, 0, 1, 1, 0, 1, 1, 0}; double[] xpoints = {428, 420, 400, 400, 400, 400, 420, 733}; double[] ypoints = {180, 180, 180, 160, 30, 10, 10, 10}; shape.moveTo( xpoints[0], ypoints[0] ); for( int i = 1; i < pointTypes.length; i++ ) { if( pointTypes[i] == 1 && i < pointTypes.length - 1 ) shape.quadTo( xpoints[i], ypoints[i], xpoints[i + 1], ypoints[i + 1] ); else shape.lineTo( xpoints[i], ypoints[i] ); } BufferedImage image = new BufferedImage(1000, 1000, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = image.createGraphics(); Color color = new Color( 124, 0, 124, 255 ); g2.setColor(color); Stroke stroke = new BasicStroke( 1.0f, 0, 0, 10.0f, new float[] {9, 6}, 0.0f ); g2.setStroke(stroke); g2.draw(shape); } } ---------- END SOURCE ----------

    JDK Bug System | 2 years ago | Webbug Group
    java.lang.InternalError: Unable to Stroke shape (null)

    Root Cause Analysis

    1. java.lang.InternalError

      Unable to Stroke shape (null)

      at sun.java2d.pipe.LoopPipe.getStrokeSpans()
    2. Java RT
      SunGraphics2D.draw
      1. sun.java2d.pipe.LoopPipe.getStrokeSpans(LoopPipe.java:268)
      2. sun.java2d.pipe.LoopPipe.draw(LoopPipe.java:213)
      3. sun.java2d.pipe.ValidatePipe.draw(ValidatePipe.java:136)
      4. sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2230)
      4 frames