Skip to content

Commit 24913dc

Browse files
committed
Suppress deprecation warning for DBCursor.OptionalFinalizer#finalize
Java 9 has deprecated Object#finalize, which generates a warning for any class overriding it. This commit suppresses that warning. When the finalize method is eventually removed, this method will become a no-op as it will never be called, but there's no reason we need to warn on it.
1 parent 3bd6dd9 commit 24913dc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

driver-legacy/src/main/com/mongodb/DBCursor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,7 @@ private void setServerCursor(@Nullable final ServerCursor serverCursor) {
10081008
}
10091009

10101010
@Override
1011+
@SuppressWarnings("deprecation")
10111012
protected void finalize() {
10121013
if (serverCursor != null) {
10131014
mongo.addOrphanedCursor(serverCursor, namespace);

0 commit comments

Comments
 (0)