From cdb3f37323ac3b098a0efad9539f9f5f271e1e93 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Mon, 20 Apr 2015 19:17:24 +0000 Subject: [PATCH] Fix some Eclipse warnings git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1674965 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xslf/usermodel/RenderableShape.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java index e3804413ac..a128056825 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/RenderableShape.java @@ -167,6 +167,7 @@ class RenderableShape { return paint; } + @SuppressWarnings("unchecked") private Paint createLinearGradientPaint( Graphics2D graphics, CTGradientFillProperties gradFill, Rectangle2D anchor, @@ -224,10 +225,12 @@ class RenderableShape { // Trick to return GradientPaint on JDK 1.5 and LinearGradientPaint on JDK 1.6+ Paint paint; try { - Class clz = Class.forName("java.awt.LinearGradientPaint"); - Class clzCycleMethod = Class.forName("java.awt.MultipleGradientPaint$CycleMethod"); - Class clzColorSpaceType = Class.forName("java.awt.MultipleGradientPaint$ColorSpaceType"); - Constructor c = + Class clz = Class.forName("java.awt.LinearGradientPaint"); + @SuppressWarnings("rawtypes") + Class clzCycleMethod = Class.forName("java.awt.MultipleGradientPaint$CycleMethod"); + @SuppressWarnings("rawtypes") + Class clzColorSpaceType = Class.forName("java.awt.MultipleGradientPaint$ColorSpaceType"); + Constructor c = clz.getConstructor(Point2D.class, Point2D.class, float[].class, Color[].class, clzCycleMethod, clzColorSpaceType, AffineTransform.class); paint = (Paint) c.newInstance(p1, p2, fractions, colors, @@ -298,8 +301,8 @@ class RenderableShape { // Trick to return GradientPaint on JDK 1.5 and RadialGradientPaint on JDK 1.6+ Paint paint; try { - Class clz = Class.forName("java.awt.RadialGradientPaint"); - Constructor c = + Class clz = Class.forName("java.awt.RadialGradientPaint"); + Constructor c = clz.getConstructor(Point2D.class, float.class, float[].class, Color[].class); paint = (Paint) c.newInstance(pCenter, radius, fractions, colors); -- 2.39.5