Repository: jclouds-karaf
Updated Branches:
  refs/heads/master 53cde3c2c -> 7fd759abf


Make constants final classes instead of interfaces

This commit prohibits implementation of the empty interface and
instantiation of the class.  Refer to _Effective Java_ item 19 for
more background.


Project: http://git-wip-us.apache.org/repos/asf/jclouds-karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-karaf/commit/7fd759ab
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-karaf/tree/7fd759ab
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-karaf/diff/7fd759ab

Branch: refs/heads/master
Commit: 7fd759abf0559cd3b7195aa623f7f8b93046cf80
Parents: 53cde3c
Author: Andrew Gaul <[email protected]>
Authored: Fri May 16 09:51:26 2014 -0700
Committer: Andrew Gaul <[email protected]>
Committed: Fri May 16 09:51:26 2014 -0700

----------------------------------------------------------------------
 .../main/java/org/jclouds/karaf/chef/core/ChefConstants.java  | 6 +++++-
 core/src/main/java/org/jclouds/karaf/core/Constants.java      | 7 +++++--
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds-karaf/blob/7fd759ab/chef/core/src/main/java/org/jclouds/karaf/chef/core/ChefConstants.java
----------------------------------------------------------------------
diff --git 
a/chef/core/src/main/java/org/jclouds/karaf/chef/core/ChefConstants.java 
b/chef/core/src/main/java/org/jclouds/karaf/chef/core/ChefConstants.java
index 1fa7352..7f58f6f 100644
--- a/chef/core/src/main/java/org/jclouds/karaf/chef/core/ChefConstants.java
+++ b/chef/core/src/main/java/org/jclouds/karaf/chef/core/ChefConstants.java
@@ -17,7 +17,7 @@
 
 package org.jclouds.karaf.chef.core;
 
-public class ChefConstants {
+public final class ChefConstants {
 
     public static final String NAME = "name";
     public static final String API = "api";
@@ -30,4 +30,8 @@ public class ChefConstants {
     public static final String CLIENT_CREDENTIAL = "client.credential";
 
     public static final String COOKBOOK_CACHE = "COOKBOOK_CACHE";
+
+    private ChefConstants() {
+        throw new AssertionError("intentionally unimplemented");
+    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-karaf/blob/7fd759ab/core/src/main/java/org/jclouds/karaf/core/Constants.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/karaf/core/Constants.java 
b/core/src/main/java/org/jclouds/karaf/core/Constants.java
index d0480f7..83b890f 100644
--- a/core/src/main/java/org/jclouds/karaf/core/Constants.java
+++ b/core/src/main/java/org/jclouds/karaf/core/Constants.java
@@ -17,8 +17,7 @@
 
 package org.jclouds.karaf.core;
 
-public class Constants {
-
+public final class Constants {
 
   public static final String NODE_CACHE = "NODE_CACHE";
   public static final String ACTIVE_NODE_CACHE = "ACTIVE_NODE_CACHE";
@@ -37,4 +36,8 @@ public class Constants {
   public static final String ENDPOINT = "endpoint";
   public static final String IDENTITY = "identity";
   public static final String CREDENTIAL = "credential";
+
+  private Constants() {
+    throw new AssertionError("intentionally unimplemented");
+  }
 }

Reply via email to