<property name="jdk.version.class" value="1.8" description="JDK version of generated class files"/>
<property name="compile.debug" value="true"/>
+ <condition property="isIBMVM">
+ <contains string="${java.vendor}" substring="IBM" casesensitive="false"/>
+ </condition>
+
<!--
Logging is suppressed by default.
To redirect log output to console, run ant with -Dorg.apache.poi.util.POILogger=org.apache.poi.util.SystemOutLogger
<jvmarg value="${java9addopens6}" />
<!-- jvmarg value="-Duser.timezone=UTC"/ -->
<jvmarg value="${file.leak.detector}" />
+ <jvmarg value="-Xjit:exclude={sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V}" if:true="${isIBMVM}"/>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest todir="${ooxml.reports.test}">
<pathelement location="${main.ant.jar}"/>
<pathelement location="${scratchpad.output.dir}"/>
</classpath>
+ <exclude name="**/HeapDump**" if:true="${isIBMVM}"/>
</javac>
<!--copy todir="${integration.output.dir}">
<fileset dir="${integration.resource1.dir}"/>
<jvmarg value="${java9addopens5}" />
<jvmarg value="${java9addopens6}" />
<jvmarg value="${file.leak.detector}" />
+ <jvmarg value="-Xjit:exclude={sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V}" if:true="${isIBMVM}"/>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest todir="${main.reports.test}">
<jvmarg value="${java9addopens4}" />
<jvmarg value="${java9addopens5}" />
<jvmarg value="${java9addopens6}" />
+ <jvmarg value="-Xjit:exclude={sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V}" if:true="${isIBMVM}"/>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest todir="${scratchpad.reports.test}">
<jvmarg value="${java9addopens6}" />
<!-- jvmarg value="-Duser.timezone=UTC"/ -->
<jvmarg value="${file.leak.detector}" />
+ <jvmarg value="-Xjit:exclude={sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V}" if:true="${isIBMVM}"/>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest todir="${ooxml.reports.test}">
<jvmarg value="${java9addopens4}" />
<jvmarg value="${java9addopens5}" />
<jvmarg value="${java9addopens6}" />
+ <jvmarg value="-Xjit:exclude={sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V}" if:true="${isIBMVM}"/>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest todir="${ooxml.reports.test}">
<jvmarg value="${java9addopens4}" />
<jvmarg value="${java9addopens5}" />
<jvmarg value="${java9addopens6}" />
+ <jvmarg value="-Xjit:exclude={sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V}" if:true="${isIBMVM}"/>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest todir="${integration.reports.test}">
<jvmarg value="${java9addopens5}" />
<jvmarg value="${java9addopens6}" />
<jvmarg value="${file.leak.detector}" />
+ <jvmarg value="-Xjit:exclude={sun/java2d/pipe/AlphaPaintPipe.renderPathTile(Ljava/lang/Object;[BIIIIII)V}" if:true="${isIBMVM}"/>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest todir="${excelant.reports.test}">
<target name="test-env" description="tests if ant is available on the jenkins slave">
<echo>Using Ant: ${ant.version} from ${ant.home}</echo>
</target>
+
+ <target name="foo">
+ <echo>${isIBMVM}</echo>
+ </target>
</project>
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;
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);
+ }
+ }
}
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;
graphics.setPaint(fillMod);
java.awt.Shape s = o.getOutline();
graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s);
- graphics.fill(s);
+ fillPaintWorkaround(graphics, s);
}
}
}
graphics.setPaint(shadowColor);
if(fill != null && p.isFilled()){
- graphics.fill(s);
+ fillPaintWorkaround(graphics, s);
} else if (line != null && p.isStroked()) {
graphics.draw(s);
}