mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
workaround for making tests pass:
temp jar files should have unique names to avoid issues with temp file scheduled for deletion
This commit is contained in:
@@ -23,6 +23,7 @@ import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.JarOutputStream;
|
||||
import java.util.jar.Manifest;
|
||||
@@ -47,7 +48,7 @@ public class CommandLineWrapperUtil {
|
||||
}
|
||||
manifest.getMainAttributes().put(Attributes.Name.CLASS_PATH, classPath.toString());
|
||||
|
||||
File jarFile = FileUtil.createTempFile("classpath", ".jar", true);
|
||||
File jarFile = FileUtil.createTempFile("classpath" + new Random().nextInt(), ".jar", true);
|
||||
new JarOutputStream(new BufferedOutputStream(new FileOutputStream(jarFile)), manifest).close();
|
||||
return jarFile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user