Jelajahi Sumber

Mark `AbstractRefCounted#mustIncRef` as `final` (#113761) (#113932)

The overridden `RefCounted` methods on `AbstractRefCounted` are all
`final`, but `mustIncRef` uses the default implementation and can still
be overridden. For the avoidance of doubt, this commit marks
`mustIncRef` as `final`.
David Turner 1 tahun lalu
induk
melakukan
9b341b139d

+ 6 - 0
libs/core/src/main/java/org/elasticsearch/core/AbstractRefCounted.java

@@ -46,6 +46,12 @@ public abstract class AbstractRefCounted implements RefCounted {
         }
     }
 
+    @Override
+    public final void mustIncRef() {
+        // making this implementation `final` (to be consistent with every other `RefCounted` method implementation)
+        RefCounted.super.mustIncRef();
+    }
+
     @Override
     public final boolean tryIncRef() {
         do {