You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2016/07/27 07:40:18 UTC
svn commit: r1754223 -
/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
Author: fmui
Date: Wed Jul 27 07:40:18 2016
New Revision: 1754223
URL: http://svn.apache.org/viewvc?rev=1754223&view=rev
Log:
CMIS-992: fixed precision handing in Browser Binding
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java?rev=1754223&r1=1754222&r2=1754223&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/JSONConverter.java Wed Jul 27 07:40:18 2016
@@ -844,8 +844,16 @@ public final class JSONConverter {
result = new PropertyDecimalDefinitionImpl();
((PropertyDecimalDefinitionImpl) result).setMinValue(getDecimal(json, JSON_PROPERTY_TYPE_MIN_VALUE));
((PropertyDecimalDefinitionImpl) result).setMaxValue(getDecimal(json, JSON_PROPERTY_TYPE_MAX_VALUE));
- ((PropertyDecimalDefinitionImpl) result).setPrecision(getIntEnum(json, JSON_PROPERTY_TYPE_PRECISION,
- DecimalPrecision.class));
+
+ String precisionStr = getString(json, JSON_PROPERTY_TYPE_PRECISION);
+ if (precisionStr != null) {
+ if ("32".equals(precisionStr)) {
+ ((PropertyDecimalDefinitionImpl) result).setPrecision(DecimalPrecision.BITS32);
+ } else if ("64".equals(precisionStr)) {
+ ((PropertyDecimalDefinitionImpl) result).setPrecision(DecimalPrecision.BITS64);
+ }
+ }
+
((PropertyDecimalDefinitionImpl) result).setChoices(convertChoicesDecimal(json
.get(JSON_PROPERTY_TYPE_CHOICE)));
break;
@@ -1636,7 +1644,7 @@ public final class JSONConverter {
result);
DecimalPrecision precision = ((PropertyDecimalDefinition) propertyDefinition).getPrecision();
if (precision != null) {
- result.put(JSON_PROPERTY_TYPE_PRECISION, precision.value());
+ result.put(JSON_PROPERTY_TYPE_PRECISION, String.valueOf(precision.value().intValue()));
}
} else if (propertyDefinition instanceof PropertyBooleanDefinition) {
// nothing to do