Author: jleroux
Date: Thu Jan  3 17:22:00 2019
New Revision: 1850253

URL: http://svn.apache.org/viewvc?rev=1850253&view=rev
Log:
Improved: Simplify ‘entity.model.ModelField#EncryptMethod’ enum
(OFBIZ-10763)

The use of an overridden abstract method for isEncrypted is a bit overkill and 
could be replaced by a simple equality check

Thanks: Mathieu Lirzin

Modified:
    
ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelField.java

Modified: 
ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelField.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelField.java?rev=1850253&r1=1850252&r2=1850253&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelField.java
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelField.java
 Thu Jan  3 17:22:00 2019
@@ -40,23 +40,13 @@ public final class ModelField extends Mo
     public static final String module = ModelField.class.getName();
 
     public enum EncryptMethod {
-        FALSE {
-            public boolean isEncrypted() {
-                return false;
-            }
-        },
-        TRUE {
-            public boolean isEncrypted() {
-                return true;
-            }
-        },
-        SALT {
-            public boolean isEncrypted() {
-                return true;
-            }
-        };
+        FALSE,
+        TRUE,
+        SALT;
 
-        public abstract boolean isEncrypted();
+        public boolean isEncrypted() {
+            return this != FALSE;
+        }
     }
 
     /**


Reply via email to