diff options
author | mwenz | 2016-09-30 14:13:40 +0000 |
---|---|---|
committer | mwenz | 2016-09-30 14:13:40 +0000 |
commit | 0261402ab939b47bfd616245015fcbdefa1107cd (patch) | |
tree | 8a576601c3be2f1ce5f356156313b4ef9313dbf0 | |
parent | 012d633cc17097875ab7bc02801d2dad84e0f187 (diff) | |
download | org.eclipse.graphiti-0261402ab939b47bfd616245015fcbdefa1107cd.tar.gz org.eclipse.graphiti-0261402ab939b47bfd616245015fcbdefa1107cd.tar.xz org.eclipse.graphiti-0261402ab939b47bfd616245015fcbdefa1107cd.zip |
Bug 497669 - IndexOutOfBoundsException below GFPolyline.createPath
(thrown in ArrayList.rangeCheck)
Change-Id: I3afa8fc66ecc722cb37b7d4ed5d7836acbd5b906
-rw-r--r-- | plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/figures/GFPolyline.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/figures/GFPolyline.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/figures/GFPolyline.java index 38d0ed93..55d04e7a 100644 --- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/figures/GFPolyline.java +++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/figures/GFPolyline.java @@ -1,7 +1,7 @@ /******************************************************************************* * <copyright> * - * Copyright (c) 2005, 2011 SAP AG. + * Copyright (c) 2005, 2016 SAP AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,7 @@ * SAP AG - initial API, implementation and documentation * mwenz - Bug 352440 - Fixed deprecation warnings - contributed by Felix Velasco * mwenz - Bug 363796 - Make setting of selection width of connections public + * mwenz - Bug 497669 - IndexOutOfBoundsException below GFPolyline.createPath (thrown in ArrayList.rangeCheck) * * </copyright> * @@ -396,7 +397,10 @@ public class GFPolyline extends GFAbstractPointListShape { PointList points = getAdjustedPointList(getPoints(), zoom, lw); List<BezierPoint> bezierPoints = getBezierPoints(points, zoom); - boolean isClosed = bezierPoints.get(0).equals(bezierPoints.get(bezierPoints.size() - 1)); + boolean isClosed = false; + if (bezierPoints != null && bezierPoints.size() > 0) { + isClosed = bezierPoints.get(0).equals(bezierPoints.get(bezierPoints.size() - 1)); + } Path path = GFFigureUtil.getBezierPath(bezierPoints, isClosed); return path; |