Commit ac0287f 1 parent 7a0a57c commit ac0287f Copy full SHA for ac0287f
File tree 1 file changed +7
-5
lines changed
src/hotspot/share/runtime
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -3294,18 +3294,20 @@ void Threads::create_vm_init_libraries() {
3294
3294
void JavaThread::invoke_shutdown_hooks () {
3295
3295
HandleMark hm (this );
3296
3296
3297
+ // We could get here with a pending exception, if so clear it now or
3298
+ // it will cause MetaspaceShared::link_and_cleanup_shared_classes to
3299
+ // fail for dynamic dump.
3300
+ if (this ->has_pending_exception ()) {
3301
+ this ->clear_pending_exception ();
3302
+ }
3303
+
3297
3304
// Link all classes for dynamic CDS dumping before vm exit.
3298
3305
// Same operation is being done in JVM_BeforeHalt for handling the
3299
3306
// case where the application calls System.exit().
3300
3307
if (DynamicDumpSharedSpaces) {
3301
3308
MetaspaceShared::link_and_cleanup_shared_classes (this );
3302
3309
}
3303
3310
3304
- // We could get here with a pending exception, if so clear it now.
3305
- if (this ->has_pending_exception ()) {
3306
- this ->clear_pending_exception ();
3307
- }
3308
-
3309
3311
EXCEPTION_MARK;
3310
3312
Klass* shutdown_klass =
3311
3313
SystemDictionary::resolve_or_null (vmSymbols::java_lang_Shutdown (),
You can’t perform that action at this time.
0 commit comments