svn commit: r1850802 - in /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity: Delegator.java GenericDelegator.java model/ModelFieldTypeReader.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1850802 - in /ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity: Delegator.java GenericDelegator.java model/ModelFieldTypeReader.java

pgil
Author: pgil
Date: Tue Jan  8 21:52:22 2019
New Revision: 1850802

URL: http://svn.apache.org/viewvc?rev=1850802&view=rev
Log:
Improved: Remove unneeded code in ‘entity’ component
(OFBIZ-10777)
Thanks Mathieu Lirzin for your contribution

Modified:
    ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/Delegator.java
    ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java
    ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelFieldTypeReader.java

Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/Delegator.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/Delegator.java?rev=1850802&r1=1850801&r2=1850802&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/Delegator.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/Delegator.java Tue Jan  8 21:52:22 2019
@@ -408,17 +408,6 @@ public interface Delegator {
     ModelFieldType getEntityFieldType(ModelEntity entity, String type) throws GenericEntityException;
 
     /**
-     * Gets field type names from the helper that corresponds to the specified
-     * entity
-     *
-     * @param entity
-     *            The entity
-     * @return Collection of field type names from the helper that corresponds
-     *         to the specified entity
-     */
-    Collection<String> getEntityFieldTypeNames(ModelEntity entity) throws GenericEntityException;
-
-    /**
      * Gets the helper name that corresponds to this delegator and the specified
      * entityName
      *

Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java?rev=1850802&r1=1850801&r2=1850802&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericDelegator.java Tue Jan  8 21:52:22 2019
@@ -574,24 +574,6 @@ public class GenericDelegator implements
     }
 
     /* (non-Javadoc)
-     * @see org.apache.ofbiz.entity.Delegator#getEntityFieldTypeNames(org.apache.ofbiz.entity.model.ModelEntity)
-     */
-    @Override
-    public Collection<String> getEntityFieldTypeNames(ModelEntity entity) throws GenericEntityException {
-        String helperName = getEntityHelperName(entity);
-
-        if (UtilValidate.isEmpty(helperName)) {
-            return null;
-        }
-        ModelFieldTypeReader modelFieldTypeReader = ModelFieldTypeReader.getModelFieldTypeReader(helperName);
-
-        if (modelFieldTypeReader == null) {
-            throw new GenericEntityException("ModelFieldTypeReader not found for entity " + entity.getEntityName() + " with helper name " + helperName);
-        }
-        return modelFieldTypeReader.getFieldTypeNames();
-    }
-
-    /* (non-Javadoc)
      * @see org.apache.ofbiz.entity.Delegator#makeValue(java.lang.String)
      */
     @Override

Modified: ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelFieldTypeReader.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelFieldTypeReader.java?rev=1850802&r1=1850801&r2=1850802&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelFieldTypeReader.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/model/ModelFieldTypeReader.java Tue Jan  8 21:52:22 2019
@@ -19,7 +19,6 @@
 package org.apache.ofbiz.entity.model;
 
 import java.io.Serializable;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -105,20 +104,6 @@ public class ModelFieldTypeReader implem
         this.fieldTypeCache = fieldTypeMap;
     }
 
-    /** Creates a Collection with all of the ModelFieldType names
-     * @return A Collection of ModelFieldType names
-     */
-    public Collection<String> getFieldTypeNames() {
-        return this.fieldTypeCache.keySet();
-    }
-
-    /** Creates a Collection with all of the ModelFieldTypes
-     * @return A Collection of ModelFieldTypes
-     */
-    public Collection<ModelFieldType> getFieldTypes() {
-        return this.fieldTypeCache.values();
-    }
-
     /** Gets an FieldType object based on a definition from the specified XML FieldType descriptor file.
      * @param fieldTypeName The fieldTypeName of the FieldType definition to use.
      * @return An FieldType object describing the specified fieldType of the specified descriptor file.