--- old/test/java/awt/Mixing/OpaqueTest.java 2015-10-08 22:05:04.105864790 +0300 +++ new/test/java/awt/Mixing/OpaqueTest.java 2015-10-08 22:05:04.009816797 +0300 @@ -27,7 +27,6 @@ @summary Tests whether opaque and non-opaque components mix correctly @author anthony.petrov@...: area=awt.mixing @library ../regtesthelpers - @modules java.desktop/com.sun.awt @build Util @run main OpaqueTest */ @@ -41,9 +40,9 @@ import java.awt.*; import java.awt.event.*; +import java.lang.reflect.Method; import javax.swing.*; import test.java.awt.regtesthelpers.Util; -import com.sun.awt.AWTUtilities; @@ -124,12 +123,10 @@ // flag value. for (int i = 0; i < 9; ++i) { if (i == 3) { - AWTUtilities.setComponentMixingCutoutShape(light, - new Rectangle()); + setMixingCutoutShape(light, new Rectangle()); } if (i == 6) { - AWTUtilities.setComponentMixingCutoutShape(light, - null); + setMixingCutoutShape(light, null); } robot.mousePress(InputEvent.BUTTON1_MASK); @@ -174,8 +171,12 @@ // instantiated in the same VM. Being static (and using // static vars), it aint gonna work. Not worrying about // it for now. - public static void main( String args[] ) throws InterruptedException + public static void main( String args[] ) throws Exception { + setMixingCutoutShapeMethod = Component.class. + getDeclaredMethod("setMixingCutoutShape", Shape.class); + setMixingCutoutShapeMethod.setAccessible(true); + mainThread = Thread.currentThread(); try { @@ -216,6 +217,17 @@ }//main + private static Method setMixingCutoutShapeMethod; + + private static void setMixingCutoutShape(Component comp, Shape shape) { + try { + setMixingCutoutShapeMethod.invoke(comp, shape); + } catch (Exception e) { + throw new RuntimeException("Cannot execute setMixingCutoutShape " + + "method"); + } + } + public static synchronized void setTimeoutTo( int seconds ) { sleepTime = seconds * 1000;