8305084: Remove the removal warnings for finalize() from test/hotspot/jtreg/serviceability/dcmd/gc/FinalizerInfoTest.java and RunFinalizationTest.java

Reviewed-by: dholmes, cjplummer
This commit is contained in:
Afshin Zafari 2023-05-05 13:22:01 +00:00 committed by Coleen Phillimore
parent 746f8d1333
commit f143bf7c45
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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
@ -36,6 +36,7 @@ public class FinalizationRunner {
static class MyObject {
@Override
@SuppressWarnings("removal")
protected void finalize() {
if (Thread.currentThread().getName().equals("Finalizer")) {
try {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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
@ -53,7 +53,7 @@ public class FinalizerInfoTest {
// Make sure object allocation/deallocation is not optimized out
wasInitialized += 1;
}
@SuppressWarnings("removal")
protected void finalize() {
// Trap the object in a finalization queue
wasTrapped += 1;