Related with issue 40905: Rollback changes, they break CI
authorAugusto Mauch <augusto.mauch@openbravo.com>
Mon, 29 Jul 2019 17:55:40 +0200
changeset 36387 85d17ee11787
parent 36386 635b9156c59d
child 36388 1e75513925e8
Related with issue 40905: Rollback changes, they break CI
src/org/openbravo/base/model/Property.java
src/org/openbravo/base/model/domaintype/DateDomainType.java
src/org/openbravo/base/model/domaintype/DomainType.java
src/org/openbravo/base/structure/BaseOBObject.java
--- a/src/org/openbravo/base/model/Property.java	Mon Jul 29 17:13:08 2019 +0200
+++ b/src/org/openbravo/base/model/Property.java	Mon Jul 29 17:55:40 2019 +0200
@@ -1377,18 +1377,4 @@
   public void setChildPropertyInParent(boolean isChildPropertyInParent) {
     this.isChildPropertyInParent = isChildPropertyInParent;
   }
-
-  /**
-   * Given an object, applies the transformation defined in its domain type
-   * 
-   * @param value
-   *          the value to be transformed
-   * @return the transformed value
-   */
-  public Object transformValue(Object value) {
-    if (domainType != null) {
-      return domainType.transformValue(this, value);
-    }
-    return value;
-  }
 }
--- a/src/org/openbravo/base/model/domaintype/DateDomainType.java	Mon Jul 29 17:13:08 2019 +0200
+++ b/src/org/openbravo/base/model/domaintype/DateDomainType.java	Mon Jul 29 17:55:40 2019 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2009-2019 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2011 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,12 +21,8 @@
 
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Calendar;
 import java.util.Date;
 
-import org.apache.commons.lang.time.DateUtils;
-import org.openbravo.base.model.Property;
-
 /**
  * The type for a date column.
  * 
@@ -81,14 +77,4 @@
     return "ob:dateTime";
   }
 
-  @Override
-  public Object transformValue(Property property, Object value) {
-    if (!(value instanceof Date)) {
-      return value;
-    }
-    // Date properties should not include information about the time, truncate the rest
-    Date dateValue = (Date) value;
-    return DateUtils.truncate(dateValue, Calendar.DATE);
-  }
-
 }
--- a/src/org/openbravo/base/model/domaintype/DomainType.java	Mon Jul 29 17:13:08 2019 +0200
+++ b/src/org/openbravo/base/model/domaintype/DomainType.java	Mon Jul 29 17:55:40 2019 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2009-2019 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2010 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -93,18 +93,4 @@
    *          the property to check
    */
   void checkObjectIsValid(BaseOBObjectDef obObject, Property property) throws ValidationException;
-
-  /**
-   * Transforms the value of an object. The default implementation is to return the original value
-   * as it is
-   * 
-   * @param property
-   *          the property which has this value
-   * @param value
-   *          the value to be transformed
-   * @return the transformed value
-   */
-  default Object transformValue(Property property, Object value) {
-    return value;
-  }
 }
--- a/src/org/openbravo/base/structure/BaseOBObject.java	Mon Jul 29 17:13:08 2019 +0200
+++ b/src/org/openbravo/base/structure/BaseOBObject.java	Mon Jul 29 17:55:40 2019 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2019 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -171,8 +171,7 @@
           + "This happens when setting property " + propName + " " + p + " with value " + value
           + " in entity " + getEntity());
     }
-    Object transformedValue = p.transformValue(value);
-    data[p.getIndexInEntity()] = transformedValue;
+    data[p.getIndexInEntity()] = value;
   }
 
   @Override