File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
test/jdk/java/awt/FontClass Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 3535import java .util .TimerTask ;
3636
3737public class DrawStringWithInfiniteXform {
38- Timer timer ;
39- boolean done ;
38+
39+ volatile Timer timer ;
40+ volatile boolean done ;
41+
4042 class ScheduleTask extends TimerTask {
4143 public void run () {
42- timer .cancel ();
4344 if (!done ) {
4445 throw new
4546 RuntimeException ("drawString with InfiniteXform transform takes long time" );
@@ -48,7 +49,7 @@ public void run() {
4849 }
4950 public DrawStringWithInfiniteXform () {
5051 timer = new Timer ();
51- timer .schedule (new ScheduleTask (), 10000 );
52+ timer .schedule (new ScheduleTask (), 20000 );
5253 }
5354
5455 public static void main (String [] args ) {
@@ -73,6 +74,7 @@ private void start() {
7374 g2d .drawString ("abc" , 20 , 20 );
7475 }
7576 done = true ;
77+ timer .cancel ();
7678 System .out .println ("Test passed" );
7779 }
7880}
You can’t perform that action at this time.
0 commit comments