Skip to content

Commit

Permalink
Make sure "finalize" methods suppress all warnings, don't @OverRide
Browse files Browse the repository at this point in the history
In preparation of a future deprecation-for-removal of the finalize
methods, make sure we don't declare @OverRide on it.

Suppress all warnings on the method that may arise from the presently
missing @OverRide statement, and the variety of code checkers
(checkstyle, PMD, errorpone, etc.)
  • Loading branch information
kohlschuetter committed Nov 10, 2023
1 parent 8a9a91d commit 699e665
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ public final void runCleaner() {
}
}

@SuppressWarnings({"all", "Finalize" /* errorprone */})
@Override
@SuppressWarnings("all")
@Deprecated
protected final void finalize() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ protected DatagramSocketImplShim() {
}

@SuppressWarnings("all")
@Override
@Deprecated
protected final void finalize() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ protected SocketImplShim() {
super();
}

@SuppressWarnings({"all", "Finalize" /* errorprone */})
@Override
@SuppressWarnings("all")
@Deprecated
protected final void finalize() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ protected SocketTestBase(AddressSpecifics<A> asp) {
}
}

@SuppressWarnings({"NoFinalizer" /* checkstyle */, "PMD.EmptyFinalizer"})
@SuppressWarnings("all")
@Deprecated
@Override
protected final void finalize() {
}

Expand Down Expand Up @@ -182,9 +181,8 @@ protected ServerThread() throws IOException, InterruptedException {
readySema.acquire();
}

@SuppressWarnings({"NoFinalizer" /* checkstyle */, "PMD.EmptyFinalizer"})
@SuppressWarnings("all")
@Deprecated
@Override
protected final void finalize() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ abstract class RemoteCloseableThingImpl implements RemoteCloseableThing {
protected RemoteCloseableThingImpl() throws RemoteException {
}

@SuppressWarnings({"NoFinalizer" /* checkstyle */, "PMD.EmptyFinalizer"})
@SuppressWarnings("all")
@Deprecated
@Override
protected final void finalize() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@ private static class SpawnedRegistryAccess implements AutoCloseable {
asyncGetRegistry();
}

@SuppressWarnings({"NoFinalizer" /* checkstyle */, "PMD.EmptyFinalizer"})
@SuppressWarnings("all")
@Deprecated
@Override
protected final void finalize() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ protected AFNaming newNamingTestInstance() throws IOException {
return AFUNIXNaming.newPrivateInstance();
}

@SuppressWarnings({"NoFinalizer" /* checkstyle */, "PMD.EmptyFinalizer"})
@SuppressWarnings("all")
@Deprecated
@Override
protected final void finalize() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ public AFTIPCTopologyWatcher(int defaultTimeoutSeconds) throws IOException {
channel.configureBlocking(false);
}

@SuppressWarnings({"NoFinalizer" /* checkstyle */, "PMD.EmptyFinalizer"})
@SuppressWarnings("all")
@Deprecated
@Override
protected final void finalize() {
}

Expand Down

0 comments on commit 699e665

Please sign in to comment.