-
Bug
-
Resolution: Not an Issue
-
P4
-
8, 11, 17, 18
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Windows 10.0.19043.1415
A DESCRIPTION OF THE PROBLEM :
When (unintentionally) running path.append() to itself, I get an undocumented ArrayIndexOutOfBoundsException. This behavior should either be documented in the javadoc, or avoided.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
nothing
ACTUAL -
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at java.awt.geom.Path2D$Float$CopyIterator.currentSegment(Path2D.java:1001)
at java.awt.geom.Path2D$Float.append(Path2D.java:730)
at NewClass.main(NewClass.java:19)
---------- BEGIN SOURCE ----------
import java.awt.geom.GeneralPath;
public class NewClass
{
public static void main(String[] args)
{
GeneralPath path = createPath();
path.append(path.getPathIterator(null), true);
}
static GeneralPath createPath()
{
GeneralPath path = new GeneralPath();
path.moveTo(150.0, 524.0);
path.lineTo(67.0, 524.0);
path.closePath();
return path;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
avoid appending path to itself
FREQUENCY : always
Windows 10.0.19043.1415
A DESCRIPTION OF THE PROBLEM :
When (unintentionally) running path.append() to itself, I get an undocumented ArrayIndexOutOfBoundsException. This behavior should either be documented in the javadoc, or avoided.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
nothing
ACTUAL -
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at java.awt.geom.Path2D$Float$CopyIterator.currentSegment(Path2D.java:1001)
at java.awt.geom.Path2D$Float.append(Path2D.java:730)
at NewClass.main(NewClass.java:19)
---------- BEGIN SOURCE ----------
import java.awt.geom.GeneralPath;
public class NewClass
{
public static void main(String[] args)
{
GeneralPath path = createPath();
path.append(path.getPathIterator(null), true);
}
static GeneralPath createPath()
{
GeneralPath path = new GeneralPath();
path.moveTo(150.0, 524.0);
path.lineTo(67.0, 524.0);
path.closePath();
return path;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
avoid appending path to itself
FREQUENCY : always