mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-11 14:11:36 +00:00
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:
parent
746f8d1333
commit
f143bf7c45
@ -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 {
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user