8256808: com/sun/jdi/CatchAllTest.java failed with "NullPointerException: Cannot invoke "lib.jdb.Jdb.log(String)" because "this.jdb" is null"

Reviewed-by: cjplummer, sspitsyn
This commit is contained in:
Alex Menkov 2020-12-03 21:31:33 +00:00
parent 85269470e5
commit c5b32b33eb
2 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -260,7 +260,7 @@ public class Jdb implements AutoCloseable {
command(JdbCommand.quit()); command(JdbCommand.quit());
} }
void log(String s) { private void log(String s) {
System.out.println(s); System.out.println(s);
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -94,9 +94,9 @@ public abstract class JdbTest {
setup(); setup();
runCases(); runCases();
} catch (Throwable e) { } catch (Throwable e) {
jdb.log("======================================="); System.out.println("=======================================");
jdb.log("Exception thrown during test execution: " + e.getMessage()); System.out.println("Exception thrown during test execution: " + e.getMessage());
jdb.log("======================================="); System.out.println("=======================================");
throw e; throw e;
} finally { } finally {
shutdown(); shutdown();