From commits-return-11882-archive-asf-public=cust-asf.ponee.io@poi.apache.org Mon Dec 10 17:18:52 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9D31C180648 for ; Mon, 10 Dec 2018 17:18:51 +0100 (CET) Received: (qmail 3057 invoked by uid 500); 10 Dec 2018 16:18:50 -0000 Mailing-List: contact commits-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@poi.apache.org Delivered-To: mailing list commits@poi.apache.org Received: (qmail 3047 invoked by uid 99); 10 Dec 2018 16:18:50 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Dec 2018 16:18:50 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 4C2F43A0551 for ; Mon, 10 Dec 2018 16:18:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1848601 - in /poi: site/src/documentation/content/xdocs/ trunk/ trunk/src/java/org/apache/poi/sl/draw/ Date: Mon, 10 Dec 2018 16:18:50 -0000 To: commits@poi.apache.org From: kiwiwings@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20181210161850.4C2F43A0551@svn01-us-west.apache.org> Author: kiwiwings Date: Mon Dec 10 16:18:49 2018 New Revision: 1848601 URL: http://svn.apache.org/viewvc?rev=1848601&view=rev Log: #62999 - IBM JDK JIT causes AIOOBE in TexturePaintContext Modified: poi/site/src/documentation/content/xdocs/changes.xml poi/trunk/build.xml poi/trunk/src/java/org/apache/poi/sl/draw/DrawBackground.java poi/trunk/src/java/org/apache/poi/sl/draw/DrawPaint.java poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java poi/trunk/src/java/org/apache/poi/sl/draw/DrawTableShape.java Modified: poi/site/src/documentation/content/xdocs/changes.xml URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/changes.xml?rev=1848601&r1=1848600&r2=1848601&view=diff ============================================================================== --- poi/site/src/documentation/content/xdocs/changes.xml (original) +++ poi/site/src/documentation/content/xdocs/changes.xml Mon Dec 10 16:18:49 2018 @@ -87,6 +87,7 @@ + IBM JDK JIT causes AIOOBE in TexturePaintContext"/> IBM JCE workarounds init presetShapeDefinitions.xml fail under IBM jdk Rendering of FreeformShapes with formula fails Modified: poi/trunk/build.xml URL: http://svn.apache.org/viewvc/poi/trunk/build.xml?rev=1848601&r1=1848600&r2=1848601&view=diff ============================================================================== --- poi/trunk/build.xml (original) +++ poi/trunk/build.xml Mon Dec 10 16:18:49 2018 @@ -60,6 +60,10 @@ under the License. + + + + + @@ -1306,6 +1311,7 @@ under the License. + + @@ -1616,6 +1625,7 @@ under the License. + @@ -1667,6 +1677,7 @@ under the License. + @@ -1755,6 +1766,7 @@ under the License. + @@ -2885,4 +2897,8 @@ under the License. Using Ant: ${ant.version} from ${ant.home} + + + ${isIBMVM} + Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawBackground.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawBackground.java?rev=1848601&r1=1848600&r2=1848601&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/sl/draw/DrawBackground.java (original) +++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawBackground.java Mon Dec 10 16:18:49 2018 @@ -17,6 +17,8 @@ package org.apache.poi.sl.draw; +import static org.apache.poi.sl.draw.DrawPaint.fillPaintWorkaround; + import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Paint; @@ -59,10 +61,10 @@ public class DrawBackground extends Draw if(fill != null) { graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, anchor); graphics.setPaint(fill); - graphics.fill(anchor2); + fillPaintWorkaround(graphics, anchor2); } } - + protected Background getShape() { return (Background)shape; } Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawPaint.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawPaint.java?rev=1848601&r1=1848600&r2=1848601&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/sl/draw/DrawPaint.java (original) +++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawPaint.java Mon Dec 10 16:18:49 2018 @@ -23,6 +23,7 @@ import java.awt.Graphics2D; import java.awt.LinearGradientPaint; import java.awt.Paint; import java.awt.RadialGradientPaint; +import java.awt.Shape; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; @@ -605,4 +606,19 @@ public class DrawPaint { return (float)(1.055d * Math.pow(linRGB / 100000d, 1.0d/2.4d) - 0.055d); } } + + + static void fillPaintWorkaround(Graphics2D graphics, Shape shape) { + // the ibm jdk has a rendering/JIT bug, which throws an AIOOBE in + // TexturePaintContext$Int.setRaster(TexturePaintContext.java:476) + // this usually doesn't happen while debugging, because JIT doesn't jump in then. + try { + graphics.fill(shape); + } catch (ArrayIndexOutOfBoundsException e) { + LOG.log(POILogger.WARN, "IBM JDK failed with TexturePaintContext AIOOBE - try adding the following to the VM parameter:\n" + + "-Xjit:exclude={sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V} and " + + "search for 'JIT Problem Determination for IBM SDK using -Xjit' (http://www-01.ibm.com/support/docview.wss?uid=swg21294023) " + + "for how to add/determine further excludes", e); + } + } } Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java?rev=1848601&r1=1848600&r2=1848601&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java (original) +++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java Mon Dec 10 16:18:49 2018 @@ -17,6 +17,8 @@ package org.apache.poi.sl.draw; +import static org.apache.poi.sl.draw.DrawPaint.fillPaintWorkaround; + import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics2D; @@ -87,7 +89,7 @@ public class DrawSimpleShape extends Dra graphics.setPaint(fillMod); java.awt.Shape s = o.getOutline(); graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s); - graphics.fill(s); + fillPaintWorkaround(graphics, s); } } } @@ -327,7 +329,7 @@ public class DrawSimpleShape extends Dra graphics.setPaint(shadowColor); if(fill != null && p.isFilled()){ - graphics.fill(s); + fillPaintWorkaround(graphics, s); } else if (line != null && p.isStroked()) { graphics.draw(s); } Modified: poi/trunk/src/java/org/apache/poi/sl/draw/DrawTableShape.java URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/draw/DrawTableShape.java?rev=1848601&r1=1848600&r2=1848601&view=diff ============================================================================== --- poi/trunk/src/java/org/apache/poi/sl/draw/DrawTableShape.java (original) +++ poi/trunk/src/java/org/apache/poi/sl/draw/DrawTableShape.java Mon Dec 10 16:18:49 2018 @@ -17,6 +17,8 @@ package org.apache.poi.sl.draw; +import static org.apache.poi.sl.draw.DrawPaint.fillPaintWorkaround; + import java.awt.Color; import java.awt.Graphics2D; import java.awt.Paint; @@ -83,8 +85,8 @@ public class DrawTableShape extends Draw Paint fillPaint = drawPaint.getPaint(graphics, tc.getFillStyle().getPaint()); graphics.setPaint(fillPaint); Rectangle2D cellAnc = tc.getAnchor(); - graphics.fill(cellAnc); - + fillPaintWorkaround(graphics, cellAnc); + for (BorderEdge edge : BorderEdge.values()) { StrokeStyle stroke = tc.getBorderStyle(edge); if (stroke == null) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org For additional commands, e-mail: commits-help@poi.apache.org