You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by mb...@apache.org on 2023/01/08 18:03:59 UTC

[db-jdo] 01/18: JDO-823: Methods should not be empty

This is an automated email from the ASF dual-hosted git repository.

mbo pushed a commit to branch JDO-823-2
in repository https://gitbox.apache.org/repos/asf/db-jdo.git

commit e7b04276d3cd8c3010482965d3ad8a49ce30225f
Author: Michael Bouschen <Mi...@akquinet.de>
AuthorDate: Sat Jan 7 20:29:56 2023 +0100

    JDO-823: Methods should not be empty
---
 api/src/main/java/javax/jdo/JDOHelper.java         |  4 +-
 .../java/javax/jdo/datastore/DataStoreCache.java   | 96 ++++++++++++++++------
 2 files changed, 72 insertions(+), 28 deletions(-)

diff --git a/api/src/main/java/javax/jdo/JDOHelper.java b/api/src/main/java/javax/jdo/JDOHelper.java
index f1103aef..87dd3fbc 100644
--- a/api/src/main/java/javax/jdo/JDOHelper.java
+++ b/api/src/main/java/javax/jdo/JDOHelper.java
@@ -146,7 +146,9 @@ public class JDOHelper implements Constants {
    *
    * @since 2.1
    */
-  public JDOHelper() {}
+  public JDOHelper() {
+    // This method is deliberately left empty, see javadoc for more info.
+  }
 
   /**
    * The stateless instance used for handling non-binary-compatible implementations of
diff --git a/api/src/main/java/javax/jdo/datastore/DataStoreCache.java b/api/src/main/java/javax/jdo/datastore/DataStoreCache.java
index d6d08501..fcdb4e01 100644
--- a/api/src/main/java/javax/jdo/datastore/DataStoreCache.java
+++ b/api/src/main/java/javax/jdo/datastore/DataStoreCache.java
@@ -147,32 +147,74 @@ public interface DataStoreCache {
    */
   public class EmptyDataStoreCache implements DataStoreCache {
 
-    public EmptyDataStoreCache() {}
-
-    public void evict(Object oid) {}
-
-    public void evictAll() {}
-
-    public void evictAll(Object... oids) {}
-
-    public void evictAll(Collection<?> oids) {}
-
-    public void evictAll(boolean subclasses, Class<?> pcClass) {}
-
-    public void pin(Object oid) {}
-
-    public void pinAll(Object... oids) {}
-
-    public void pinAll(Collection<?> oids) {}
-
-    public void pinAll(boolean subclasses, Class<?> pcClass) {}
-
-    public void unpin(Object oid) {}
-
-    public void unpinAll(Object... oids) {}
-
-    public void unpinAll(Collection<?> oids) {}
-
-    public void unpinAll(boolean subclasses, Class<?> pcClass) {}
+    public EmptyDataStoreCache() {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void evict(Object oid) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void evictAll() {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void evictAll(Object... oids) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void evictAll(Collection<?> oids) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void evictAll(boolean subclasses, Class<?> pcClass) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void pin(Object oid) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void pinAll(Object... oids) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void pinAll(Collection<?> oids) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void pinAll(boolean subclasses, Class<?> pcClass) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void unpin(Object oid) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void unpinAll(Object... oids) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void unpinAll(Collection<?> oids) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
+
+    public void unpinAll(boolean subclasses, Class<?> pcClass) {
+      // This method is deliberately left empty,
+      // to be used by an implementation that does not support a second-level cache.
+    }
   }
 }