changeset 15899:11e15af1947f

8160213: tools/pack200/Utils.java should clean up javac*.tmp files Reviewed-by: darcy
author ksrini
date Tue, 25 Oct 2016 07:38:50 -0700
parents a80fd00b0cd0
children 95a8c745128a 490854ad860c
files test/tools/pack200/MultiRelease.java test/tools/pack200/Utils.java
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/pack200/MultiRelease.java	Tue Oct 25 10:31:49 2016 +0100
+++ b/test/tools/pack200/MultiRelease.java	Tue Oct 25 07:38:50 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, 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
@@ -60,6 +60,7 @@
         } else {
             System.out.println("All tests(" + pass + ") passes");
         }
+        Utils.cleanup();
     }
 
     /*
--- a/test/tools/pack200/Utils.java	Tue Oct 25 10:31:49 2016 +0100
+++ b/test/tools/pack200/Utils.java	Tue Oct 25 07:38:50 2016 -0700
@@ -94,7 +94,7 @@
         }
         File srcDir = new File(getVerifierDir(), "src");
         List<File> javaFileList = findFiles(srcDir, createFilter(JAVA_FILE_EXT));
-        File tmpFile = File.createTempFile("javac", ".tmp");
+        File tmpFile = File.createTempFile("javac", ".tmp", new File("."));
         XCLASSES.mkdirs();
         FileOutputStream fos = null;
         PrintStream ps = null;
@@ -208,6 +208,10 @@
                 Utils.createFilter(".idx")));
         toDelete.addAll(Utils.findFiles(new File("."),
                 Utils.createFilter(".gidx")));
+        toDelete.addAll(Utils.findFiles(new File("."),
+                Utils.createFilter(".tmp")));
+        toDelete.addAll(Utils.findFiles(new File("."),
+                Utils.createFilter(".class")));
         for (File f : toDelete) {
             f.delete();
         }