8031525: Logger created in test/tools/jar/UpdateManifest.java might get gc'ed too early

The test needs to keep a strong reference on its loggers otherwise the modification of the logger level may only be transient.

Reviewed-by: chegar
This commit is contained in:
Daniel Fuchs 2014-01-10 19:48:02 +01:00
parent ad40a93e8a
commit 01a0c50d3f

@ -39,6 +39,8 @@ public class UpdateManifest {
static PrintStream err = System.err;
static boolean debug = true;
static final Logger JAR_LOGGER = Logger.getLogger("java.util.jar");
public static void realMain(String[] args) throws Throwable {
if (args.length == 0) {
debug = false;
@ -47,7 +49,7 @@ public class UpdateManifest {
out = new PrintStream(new FileOutputStream(tmp));
err = out;
// Attributes.read() can log a message we don't care to see.
Logger.getLogger("java.util.jar").setLevel(Level.OFF);
JAR_LOGGER.setLevel(Level.OFF);
}
try { testManifestExistence(); } catch (Throwable t) { unexpected(t); }