test/jdk/jdk/jfr/event/io/EvilInstrument.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 51214 67736b4846a0
child 58679 9c3209ff7550
--- a/test/jdk/jdk/jfr/event/io/EvilInstrument.java	Thu Oct 17 20:27:44 2019 +0100
+++ b/test/jdk/jdk/jfr/event/io/EvilInstrument.java	Thu Oct 17 20:53:35 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,6 +38,7 @@
 import java.net.Socket;
 import java.security.ProtectionDomain;
 import java.util.concurrent.CountDownLatch;
+import jdk.test.lib.Utils;
 
 
 /**
@@ -51,6 +52,7 @@
  * @library /test/lib /test/jdk
  * @modules java.instrument
  *
+ * @build jdk.jfr.event.io.EvilInstrument
  * @run shell MakeJAR.sh EvilInstrument 'Can-Redefine-Classes: true'
  * @run main/othervm -javaagent:EvilInstrument.jar jdk.jfr.event.io.EvilInstrument
  */
@@ -87,7 +89,7 @@
     }
 
     public static File createScratchFile() throws IOException {
-        return File.createTempFile("EvilTransformer", null, new File(".")).getAbsoluteFile();
+        return Utils.createTempFile("EvilTransformer", null).toFile();
     }
 
     class EvilTransformer implements ClassFileTransformer {