You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/09/03 11:29:52 UTC

[2/2] git commit: [OLINGO-356] Rework EdmPrimitive Type exceptions

[OLINGO-356] Rework EdmPrimitive Type exceptions


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/3ece19c9
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/3ece19c9
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/3ece19c9

Branch: refs/heads/master
Commit: 3ece19c964bdefb7cee68d6ffd7d959f59238655
Parents: f3289fb
Author: Michael Bolz <mi...@sap.com>
Authored: Wed Sep 3 11:04:36 2014 +0200
Committer: Michael Bolz <mi...@sap.com>
Committed: Wed Sep 3 11:05:24 2014 +0200

----------------------------------------------------------------------
 .../api/edm/EdmPrimitiveTypeException.java      |   4 +-
 .../commons/core/edm/AbstractEdmEnumType.java   |  22 ++--
 .../primitivetype/AbstractGeospatialType.java   |  32 ++---
 .../primitivetype/AbstractPrimitiveType.java    |  13 +--
 .../core/edm/primitivetype/EdmBinary.java       |  13 +--
 .../core/edm/primitivetype/EdmBoolean.java      |   9 +-
 .../commons/core/edm/primitivetype/EdmByte.java |  22 ++--
 .../commons/core/edm/primitivetype/EdmDate.java |   8 +-
 .../core/edm/primitivetype/EdmDateTime.java     |  11 +-
 .../edm/primitivetype/EdmDateTimeOffset.java    |  23 ++--
 .../core/edm/primitivetype/EdmDecimal.java      |  23 ++--
 .../core/edm/primitivetype/EdmDouble.java       |  22 ++--
 .../core/edm/primitivetype/EdmDuration.java     |  19 ++-
 .../core/edm/primitivetype/EdmGeography.java    |   8 +-
 .../primitivetype/EdmGeographyCollection.java   |   6 +-
 .../primitivetype/EdmGeographyLineString.java   |   6 +-
 .../EdmGeographyMultiLineString.java            |   6 +-
 .../primitivetype/EdmGeographyMultiPoint.java   |   6 +-
 .../primitivetype/EdmGeographyMultiPolygon.java |   6 +-
 .../edm/primitivetype/EdmGeographyPoint.java    |   6 +-
 .../edm/primitivetype/EdmGeographyPolygon.java  |   6 +-
 .../core/edm/primitivetype/EdmGeometry.java     |   8 +-
 .../primitivetype/EdmGeometryCollection.java    |   6 +-
 .../primitivetype/EdmGeometryLineString.java    |   6 +-
 .../EdmGeometryMultiLineString.java             |   6 +-
 .../primitivetype/EdmGeometryMultiPoint.java    |   7 +-
 .../primitivetype/EdmGeometryMultiPolygon.java  |   6 +-
 .../edm/primitivetype/EdmGeometryPoint.java     |   6 +-
 .../edm/primitivetype/EdmGeometryPolygon.java   |   6 +-
 .../commons/core/edm/primitivetype/EdmGuid.java |   9 +-
 .../core/edm/primitivetype/EdmInt16.java        |  19 ++-
 .../core/edm/primitivetype/EdmInt32.java        |  18 ++-
 .../core/edm/primitivetype/EdmInt64.java        |  16 +--
 .../core/edm/primitivetype/EdmSByte.java        |  15 +--
 .../core/edm/primitivetype/EdmSingle.java       |  24 ++--
 .../core/edm/primitivetype/EdmStream.java       |   8 +-
 .../core/edm/primitivetype/EdmString.java       |   9 +-
 .../core/edm/primitivetype/EdmTimeOfDay.java    |  16 +--
 .../primitivetype/PrimitiveTypeBaseTest.java    |  44 ++++---
 .../server/core/edm/provider/EdmEnumTest.java   | 106 +++++++++++++----
 .../edm/provider/PrimitiveTypeBaseTest.java     | 117 -------------------
 41 files changed, 273 insertions(+), 450 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
index fb59ec1..e6cc319 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeException.java
@@ -18,7 +18,9 @@
  */
 package org.apache.olingo.commons.api.edm;
 
-public class EdmPrimitiveTypeException extends Exception {
+import org.apache.olingo.commons.api.ODataException;
+
+public class EdmPrimitiveTypeException extends ODataException {
 
   private static final long serialVersionUID = -93578822384514620L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEnumType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEnumType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEnumType.java
index 4790dea..0172607 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEnumType.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/AbstractEdmEnumType.java
@@ -112,8 +112,7 @@ public abstract class AbstractEdmEnumType extends EdmTypeImpl implements EdmEnum
         }
       }
       if (memberValueLong == null) {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
       }
       result = result == null ? memberValueLong : result | memberValueLong;
     }
@@ -127,7 +126,7 @@ public abstract class AbstractEdmEnumType extends EdmTypeImpl implements EdmEnum
 
     if (value == null) {
       if (isNullable != null && !isNullable) {
-        throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_NULL_NOT_ALLOWED");
+        throw new EdmPrimitiveTypeException("The literal 'null' is not allowed.");
       }
       return null;
     }
@@ -135,11 +134,10 @@ public abstract class AbstractEdmEnumType extends EdmTypeImpl implements EdmEnum
     try {
       return EdmInt64.convertNumber(parseEnumValue(value), returnType);
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+      throw new EdmPrimitiveTypeException("The literal '" + value
+          + "' cannot be converted to value type " + returnType + ".", e);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 
@@ -159,8 +157,7 @@ public abstract class AbstractEdmEnumType extends EdmTypeImpl implements EdmEnum
     }
 
     if (remaining != 0) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
     }
     return result.toString();
   }
@@ -171,15 +168,14 @@ public abstract class AbstractEdmEnumType extends EdmTypeImpl implements EdmEnum
 
     if (value == null) {
       if (isNullable != null && !isNullable) {
-        throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_NULL_NOT_ALLOWED");
+        throw new EdmPrimitiveTypeException("The value NULL is not allowed.");
       }
       return null;
     }
     if (value instanceof Byte || value instanceof Short || value instanceof Integer || value instanceof Long) {
       return constructEnumValue(((Number) value).longValue());
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 
@@ -199,7 +195,7 @@ public abstract class AbstractEdmEnumType extends EdmTypeImpl implements EdmEnum
         && literal.startsWith(uriPrefix) && literal.endsWith(uriSuffix)) {
       return literal.substring(uriPrefix.length(), literal.length() - uriSuffix.length());
     } else {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(literal)");
+      throw new EdmPrimitiveTypeException("The literal '" + literal + "' has illegal content.");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java
index afdb4eb..96ab236 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractGeospatialType.java
@@ -67,7 +67,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
   private Matcher getMatcher(final Pattern pattern, final String value) throws EdmPrimitiveTypeException {
     final Matcher matcher = pattern.matcher(value);
     if (!matcher.matches()) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
 
     Geospatial.Dimension _dimension = null;
@@ -76,10 +76,10 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
       _dimension = Geospatial.Dimension.valueOf(matcher.group(1).toUpperCase());
       _type = Geospatial.Type.valueOf(matcher.group(3).toUpperCase());
     } catch (IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e);
     }
     if (_dimension != this.dimension || (!pattern.equals(COLLECTION_PATTERN) && _type != this.type)) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
 
     return matcher;
@@ -91,7 +91,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
 
     final String[] pointCoo = StringUtils.split(point, ' ');
     if (pointCoo == null || pointCoo.length != 2) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + point + "' has illegal content.");
     }
 
     final Point result = new Point(this.dimension, srid);
@@ -309,8 +309,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
 
     if (dimension != point.getDimension()) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The value '" + point + "' is not valid.");
     }
 
     return toStringBuilder(point.getSrid()).
@@ -325,8 +324,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
 
     if (dimension != multiPoint.getDimension()) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The value '" + multiPoint + "' is not valid.");
     }
 
     final StringBuilder result = toStringBuilder(multiPoint.getSrid()).
@@ -365,8 +363,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
 
     if (dimension != lineString.getDimension()) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The value '" + lineString + "' is not valid.");
     }
 
     return toStringBuilder(lineString.getSrid()).
@@ -380,8 +377,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
 
     if (dimension != multiLineString.getDimension()) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The value '" + multiLineString + "' is not valid.");
     }
 
     final StringBuilder result = toStringBuilder(multiLineString.getSrid()).
@@ -428,8 +424,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
 
     if (dimension != polygon.getDimension()) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The value '" + polygon + "' is not valid.");
     }
 
     return toStringBuilder(polygon.getSrid()).
@@ -443,8 +438,7 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
 
     if (dimension != multiPolygon.getDimension()) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The value '" + multiPolygon + "' is not valid.");
     }
 
     final StringBuilder result = toStringBuilder(multiPolygon.getSrid()).
@@ -467,12 +461,10 @@ public abstract class AbstractGeospatialType<T extends Geospatial> extends Singl
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
 
     if (dimension != collection.getDimension()) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The value '" + collection + "' is not valid.");
     }
 
-    final StringBuilder result = toStringBuilder(collection.getSrid()).
-        append("Collection(");
+    StringBuilder result = toStringBuilder(collection.getSrid()).append("Collection(");
 
     if (collection.iterator().hasNext()) {
       final Geospatial item = collection.iterator().next();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractPrimitiveType.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractPrimitiveType.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractPrimitiveType.java
index 79d7bb5..4928d17 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractPrimitiveType.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/AbstractPrimitiveType.java
@@ -62,7 +62,7 @@ abstract class AbstractPrimitiveType implements EdmPrimitiveType {
 
     if (value == null) {
       if (isNullable != null && !isNullable) {
-        throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_NULL_NOT_ALLOWED");
+        throw new EdmPrimitiveTypeException("The literal 'null' is not allowed.");
       }
       return null;
     }
@@ -79,7 +79,7 @@ abstract class AbstractPrimitiveType implements EdmPrimitiveType {
       final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
     if (value == null) {
       if (isNullable != null && !isNullable) {
-        throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_NULL_NOT_ALLOWED");
+        throw new EdmPrimitiveTypeException("The value NULL is not allowed.");
       }
       return null;
     }
@@ -92,11 +92,8 @@ abstract class AbstractPrimitiveType implements EdmPrimitiveType {
 
   @Override
   public String toUriLiteral(final String literal) {
-    return literal == null
-        ? null
-        : uriPrefix.isEmpty() && uriSuffix.isEmpty()
-            ? literal
-            : uriPrefix + literal + uriSuffix;
+    return literal == null ? null :
+        uriPrefix.isEmpty() && uriSuffix.isEmpty() ? literal : uriPrefix + literal + uriSuffix;
   }
 
   @Override
@@ -110,7 +107,7 @@ abstract class AbstractPrimitiveType implements EdmPrimitiveType {
 
       return literal.substring(uriPrefix.length(), literal.length() - uriSuffix.length());
     } else {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(literal)");
+      throw new EdmPrimitiveTypeException("The literal '" + literal + "' has illegal content.");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinary.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinary.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinary.java
index 4c1be32..8e1c95e 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinary.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBinary.java
@@ -163,11 +163,10 @@ public class EdmBinary extends SingletonPrimitiveType {
           final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
 
     if (value == null || !isBase64(value.getBytes(UTF_8))) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
     if (!validateMaxLength(value, maxLength)) {
-      throw new EdmPrimitiveTypeException(
-              "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' does not match the facets' constraints.");
     }
 
     final byte[] result = Base64.decodeBase64(value.getBytes(UTF_8));
@@ -181,7 +180,7 @@ public class EdmBinary extends SingletonPrimitiveType {
       }
       return returnType.cast(byteArray);
     } else {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -200,13 +199,11 @@ public class EdmBinary extends SingletonPrimitiveType {
         byteArrayValue[i] = ((Byte[]) value)[i].byteValue();
       }
     } else {
-      throw new EdmPrimitiveTypeException(
-              "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
 
     if (maxLength != null && byteArrayValue.length > maxLength) {
-      throw new EdmPrimitiveTypeException(
-              "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
+      throw new EdmPrimitiveTypeException("The value '" + value + "' does not match the facets' constraints.");
     }
 
     return new String(Base64.encodeBase64(byteArrayValue, false), UTF_8);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBoolean.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBoolean.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBoolean.java
index 776d5f1..b009a65 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBoolean.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmBoolean.java
@@ -57,12 +57,10 @@ public final class EdmBoolean extends SingletonPrimitiveType {
       if (returnType.isAssignableFrom(Boolean.class)) {
         return returnType.cast(Boolean.valueOf("true".equals(value)));
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+        throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
       }
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
   }
 
@@ -74,8 +72,7 @@ public final class EdmBoolean extends SingletonPrimitiveType {
     if (value instanceof Boolean) {
       return Boolean.toString((Boolean) value);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByte.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByte.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByte.java
index e13a8ef..68d1e1b 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByte.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmByte.java
@@ -54,22 +54,19 @@ public final class EdmByte extends SingletonPrimitiveType {
     try {
       valueShort = Short.parseShort(value);
     } catch (final NumberFormatException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e);
     }
     if (valueShort < 0 || valueShort >= 1 << Byte.SIZE) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
 
     try {
       return EdmInt64.convertNumber(valueShort, returnType);
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+      throw new EdmPrimitiveTypeException("The literal '" + value
+          + "' cannot be converted to value type " + returnType + ".", e);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 
@@ -82,20 +79,17 @@ public final class EdmByte extends SingletonPrimitiveType {
       if (((Number) value).longValue() >= 0 && ((Number) value).longValue() < 1 << Byte.SIZE) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else if (value instanceof BigInteger) {
       if (((BigInteger) value).compareTo(BigInteger.ZERO) >= 0
           && ((BigInteger) value).compareTo(BigInteger.valueOf(1 << Byte.SIZE)) < 0) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDate.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDate.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDate.java
index 437ed18..71b747f 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDate.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDate.java
@@ -53,7 +53,7 @@ public final class EdmDate extends SingletonPrimitiveType {
 
     final Matcher matcher = PATTERN.matcher(value);
     if (!matcher.matches()) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
 
     dateTimeValue.set(
@@ -64,11 +64,9 @@ public final class EdmDate extends SingletonPrimitiveType {
     try {
       return EdmDateTimeOffset.convertDateTime(dateTimeValue, 0, returnType);
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)", e);
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTime.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTime.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTime.java
index dd5d0ec..6862484 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTime.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTime.java
@@ -61,7 +61,7 @@ public final class EdmDateTime extends SingletonPrimitiveType {
     try {
       date = DATE_FORMAT.get().parse(dateParts[0]);
     } catch (ParseException e) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e);
     }
 
     TimeZone timezone = null;
@@ -85,8 +85,7 @@ public final class EdmDateTime extends SingletonPrimitiveType {
 
     if (decimals != null) {
       if (decimals.length() > (precision == null ? 0 : precision)) {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
+        throw new EdmPrimitiveTypeException("The literal '" + value + "' does not match the facets' constraints.");
       }
       final String milliSeconds = decimals.length() > 3
           ? decimals.substring(0, 3)
@@ -105,8 +104,8 @@ public final class EdmDateTime extends SingletonPrimitiveType {
     } else if (returnType.isAssignableFrom(Timestamp.class)) {
       return returnType.cast(timestamp);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType)");
+      throw new EdmPrimitiveTypeException("The literal '" + value
+          + "' cannot be converted to value type " + returnType + ".");
     }
   }
 
@@ -130,7 +129,7 @@ public final class EdmDateTime extends SingletonPrimitiveType {
       EdmDateTimeOffset.appendFractionalSeconds(result, fractionalSecs, precision);
       return result.toString();
     } else {
-      throw new EdmPrimitiveTypeException("EdmDateTime only supports conversion from Calendar and Timestamp");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java
index c3b4bcc..6646c83 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java
@@ -63,15 +63,14 @@ public final class EdmDateTimeOffset extends SingletonPrimitiveType {
 
     final Matcher matcher = PATTERN.matcher(value);
     if (!matcher.matches()) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
 
     final String timeZoneOffset = matcher.group(9) == null || matcher.group(10) == null
             || matcher.group(10).matches("[-+]0+:0+") ? null : matcher.group(10);
     final Calendar dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT" + timeZoneOffset));
     if (dateTimeValue.get(Calendar.ZONE_OFFSET) == 0 && timeZoneOffset != null) {
-      throw new EdmPrimitiveTypeException(
-              "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
     dateTimeValue.clear();
 
@@ -86,13 +85,11 @@ public final class EdmDateTimeOffset extends SingletonPrimitiveType {
     int nanoSeconds = 0;
     if (matcher.group(7) != null) {
       if (matcher.group(7).length() == 1 || matcher.group(7).length() > 13) {
-        throw new EdmPrimitiveTypeException(
-                "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
       }
       final String decimals = matcher.group(8);
       if (decimals.length() > (precision == null ? 0 : precision)) {
-        throw new EdmPrimitiveTypeException(
-                "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
+        throw new EdmPrimitiveTypeException("The literal '" + value + "' does not match the facets' constraints.");
       }
       if (returnType.isAssignableFrom(Timestamp.class)) {
         if (!decimals.isEmpty()) {
@@ -110,11 +107,9 @@ public final class EdmDateTimeOffset extends SingletonPrimitiveType {
     try {
       return convertDateTime(dateTimeValue, nanoSeconds, returnType);
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-              "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-              "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)", e);
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 
@@ -196,8 +191,7 @@ public final class EdmDateTimeOffset extends SingletonPrimitiveType {
         appendMilliseconds(result, fractionalSecs, precision);
       }
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-              "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)", e);
+      throw new EdmPrimitiveTypeException("The value '" + value + "' does not match the facets' constraints.", e);
     }
 
     final int offsetInMinutes = (dateTimeValue.get(Calendar.ZONE_OFFSET)
@@ -231,8 +225,7 @@ public final class EdmDateTimeOffset extends SingletonPrimitiveType {
       dateTimeValue = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
       dateTimeValue.setTimeInMillis((Long) value);
     } else {
-      throw new EdmPrimitiveTypeException(
-              "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(" + value.getClass().getName() + ")");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
     return dateTimeValue;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimal.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimal.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimal.java
index f67caf9..b9e3904 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimal.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDecimal.java
@@ -89,21 +89,19 @@ public final class EdmDecimal extends SingletonPrimitiveType {
       final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException {
 
     if (!validateLiteral(value)) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
     if (!validatePrecisionAndScale(value, precision, scale)) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(value, facets)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' does not match the facets' constraints.");
     }
 
     try {
       return convertDecimal(new BigDecimal(value), returnType);
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+      throw new EdmPrimitiveTypeException("The literal '" + value
+          + "' cannot be converted to value type " + returnType + ".", e);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 
@@ -168,8 +166,7 @@ public final class EdmDecimal extends SingletonPrimitiveType {
       result = value.toString();
       final int digits = result.startsWith("-") ? result.length() - 1 : result.length();
       if (precision != null && precision < digits) {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' does not match the facets' constraints.");
       }
 
     } else if (value instanceof Double || value instanceof Float || value instanceof BigDecimal) {
@@ -178,7 +175,7 @@ public final class EdmDecimal extends SingletonPrimitiveType {
         bigDecimalValue = value instanceof Double ? BigDecimal.valueOf((Double) value)
             : value instanceof Float ? BigDecimal.valueOf((Float) value) : (BigDecimal) value;
       } catch (final NumberFormatException e) {
-        throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)", e);
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.", e);
       }
 
       final int digits = bigDecimalValue.scale() >= 0
@@ -187,13 +184,11 @@ public final class EdmDecimal extends SingletonPrimitiveType {
       if ((precision == null || precision >= digits) && (bigDecimalValue.scale() <= (scale == null ? 0 : scale))) {
         result = bigDecimalValue.toPlainString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' does not match the facets' constraints.");
       }
 
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
 
     return result;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDouble.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDouble.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDouble.java
index b085d95..be9b5a9 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDouble.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDouble.java
@@ -78,7 +78,7 @@ public final class EdmDouble extends SingletonPrimitiveType {
     } else {
       // Now only "normal" numbers remain.
       if (!PATTERN.matcher(value).matches()) {
-        throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
       }
 
       // The number format is checked above, so we don't have to catch NumberFormatException.
@@ -87,7 +87,7 @@ public final class EdmDouble extends SingletonPrimitiveType {
       // "Real" infinite values have been treated already above, so we can throw an exception
       // if the conversion to a double results in an infinite value.
       if (result.isInfinite() || BigDecimal.valueOf(result).compareTo(bigDecimalValue) != 0) {
-        throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
       }
     }
 
@@ -97,18 +97,17 @@ public final class EdmDouble extends SingletonPrimitiveType {
       if (returnType.isAssignableFrom(Float.class)) {
         return returnType.cast(result.floatValue());
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType)");
+        throw new EdmPrimitiveTypeException("The literal '" + value
+            + "' cannot be converted to value type " + returnType + ".");
       }
     } else {
       try {
         return EdmDecimal.convertDecimal(bigDecimalValue, returnType);
       } catch (final IllegalArgumentException e) {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+        throw new EdmPrimitiveTypeException("The literal '" + value
+            + "' cannot be converted to value type " + returnType + ".", e);
       } catch (final ClassCastException e) {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+        throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
       }
     }
   }
@@ -121,7 +120,7 @@ public final class EdmDouble extends SingletonPrimitiveType {
       if (Math.abs((Long) value) < 1L << 51) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else if (value instanceof Integer || value instanceof Short || value instanceof Byte) {
       return value.toString();
@@ -136,11 +135,10 @@ public final class EdmDouble extends SingletonPrimitiveType {
       if (!Double.isInfinite(doubleValue) && BigDecimal.valueOf(doubleValue).compareTo((BigDecimal) value) == 0) {
         return ((BigDecimal) value).toString();
       } else {
-        throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDuration.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDuration.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDuration.java
index f350b56..b0de820 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDuration.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDuration.java
@@ -56,8 +56,7 @@ public class EdmDuration extends SingletonPrimitiveType {
     if (!matcher.matches()
         || matcher.group(1) == null && matcher.group(2) == null && matcher.group(3) == null
         && matcher.group(4) == null) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(literal)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
 
     BigDecimal result = (matcher.group(1) == null ? BigDecimal.ZERO
@@ -71,18 +70,16 @@ public class EdmDuration extends SingletonPrimitiveType {
     if (result.scale() <= (precision == null ? 0 : precision)) {
       result = value.charAt(0) == '-' ? result.negate() : result;
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_FACETS_NOT_MATCHED.addContent(literal, facets)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' does not match the facets' constraints.");
     }
 
     try {
       return EdmDecimal.convertDecimal(result, returnType);
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+      throw new EdmPrimitiveTypeException("The literal '" + value
+          + "' cannot be converted to value type " + returnType + ".", e);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 
@@ -99,13 +96,11 @@ public class EdmDuration extends SingletonPrimitiveType {
     } else if (value instanceof BigInteger) {
       valueDecimal = new BigDecimal((BigInteger) value);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
 
     if (valueDecimal.scale() > (precision == null ? 0 : precision)) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets)");
+      throw new EdmPrimitiveTypeException("The value '" + value + "' does not match the facets' constraints.");
     }
 
     final StringBuilder result = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeography.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeography.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeography.java
index 53d6d97..16db86d 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeography.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeography.java
@@ -38,16 +38,12 @@ public final class EdmGeography extends AbstractGeospatialType<Geospatial> {
   protected <T> T internalValueOfString(final String value, final Boolean isNullable, final Integer maxLength,
       final Integer precision, final Integer scale, final Boolean isUnicode, final Class<T> returnType)
       throws EdmPrimitiveTypeException {
-
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+    throw new EdmPrimitiveTypeException("Not implemented!");
   }
 
   @Override
   protected <T> String internalValueToString(final T value, final Boolean isNullable, final Integer maxLength,
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("Not implemented!");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyCollection.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyCollection.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyCollection.java
index e32fb0e..4ee35a2 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyCollection.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyCollection.java
@@ -45,8 +45,7 @@ public final class EdmGeographyCollection extends AbstractGeospatialType<Geospat
     if (returnType.isAssignableFrom(GeospatialCollection.class)) {
       return returnType.cast(collection);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -58,7 +57,6 @@ public final class EdmGeographyCollection extends AbstractGeospatialType<Geospat
       return toString((GeospatialCollection) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyLineString.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyLineString.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyLineString.java
index 5691261..9027ed1 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyLineString.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyLineString.java
@@ -44,8 +44,7 @@ public final class EdmGeographyLineString extends AbstractGeospatialType<LineStr
     if (returnType.isAssignableFrom(LineString.class)) {
       return returnType.cast(lineString);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -57,7 +56,6 @@ public final class EdmGeographyLineString extends AbstractGeospatialType<LineStr
       return toString((LineString) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiLineString.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiLineString.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiLineString.java
index 5f5b63c..6cd17b9 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiLineString.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiLineString.java
@@ -45,8 +45,7 @@ public final class EdmGeographyMultiLineString extends AbstractGeospatialType<Mu
     if (returnType.isAssignableFrom(MultiLineString.class)) {
       return returnType.cast(multiLineString);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -58,7 +57,6 @@ public final class EdmGeographyMultiLineString extends AbstractGeospatialType<Mu
       return toString((MultiLineString) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPoint.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPoint.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPoint.java
index 7378e6b..f10aef7 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPoint.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPoint.java
@@ -44,8 +44,7 @@ public final class EdmGeographyMultiPoint extends AbstractGeospatialType<MultiPo
     if (returnType.isAssignableFrom(MultiPoint.class)) {
       return returnType.cast(point);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
 
   }
@@ -58,8 +57,7 @@ public final class EdmGeographyMultiPoint extends AbstractGeospatialType<MultiPo
       return toString((MultiPoint) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPolygon.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPolygon.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPolygon.java
index ead1e44..f9c1012 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPolygon.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyMultiPolygon.java
@@ -44,8 +44,7 @@ public final class EdmGeographyMultiPolygon extends AbstractGeospatialType<Multi
     if (returnType.isAssignableFrom(MultiPolygon.class)) {
       return returnType.cast(multiPolygon);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -57,7 +56,6 @@ public final class EdmGeographyMultiPolygon extends AbstractGeospatialType<Multi
       return toString((MultiPolygon) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPoint.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPoint.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPoint.java
index 25ceb85..eae0fdc 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPoint.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPoint.java
@@ -44,8 +44,7 @@ public final class EdmGeographyPoint extends AbstractGeospatialType<Point> {
     if (returnType.isAssignableFrom(Point.class)) {
       return returnType.cast(point);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -57,8 +56,7 @@ public final class EdmGeographyPoint extends AbstractGeospatialType<Point> {
       return toString((Point) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPolygon.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPolygon.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPolygon.java
index 994ac09..a9ccbfa 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPolygon.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeographyPolygon.java
@@ -44,8 +44,7 @@ public final class EdmGeographyPolygon extends AbstractGeospatialType<Polygon> {
     if (returnType.isAssignableFrom(Polygon.class)) {
       return returnType.cast(polygon);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -57,7 +56,6 @@ public final class EdmGeographyPolygon extends AbstractGeospatialType<Polygon> {
       return toString((Polygon) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometry.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometry.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometry.java
index 64160dd..12e3994 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometry.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometry.java
@@ -38,16 +38,12 @@ public final class EdmGeometry extends AbstractGeospatialType<Geospatial> {
   protected <T> T internalValueOfString(final String value, final Boolean isNullable, final Integer maxLength,
       final Integer precision, final Integer scale, final Boolean isUnicode, final Class<T> returnType)
       throws EdmPrimitiveTypeException {
-
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+    throw new EdmPrimitiveTypeException("Not implemented!");
   }
 
   @Override
   protected <T> String internalValueToString(final T value, final Boolean isNullable, final Integer maxLength,
       final Integer precision, final Integer scale, final Boolean isUnicode) throws EdmPrimitiveTypeException {
-
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("Not implemented!");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryCollection.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryCollection.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryCollection.java
index 510d24a..a03fb5f 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryCollection.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryCollection.java
@@ -45,8 +45,7 @@ public final class EdmGeometryCollection extends AbstractGeospatialType<Geospati
     if (returnType.isAssignableFrom(GeospatialCollection.class)) {
       return returnType.cast(collection);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -58,7 +57,6 @@ public final class EdmGeometryCollection extends AbstractGeospatialType<Geospati
       return toString((GeospatialCollection) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryLineString.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryLineString.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryLineString.java
index a12b8de..013f466 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryLineString.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryLineString.java
@@ -44,8 +44,7 @@ public final class EdmGeometryLineString extends AbstractGeospatialType<LineStri
     if (returnType.isAssignableFrom(LineString.class)) {
       return returnType.cast(lineString);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -57,7 +56,6 @@ public final class EdmGeometryLineString extends AbstractGeospatialType<LineStri
       return toString((LineString) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiLineString.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiLineString.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiLineString.java
index a86ab93..d4502b2 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiLineString.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiLineString.java
@@ -45,8 +45,7 @@ public final class EdmGeometryMultiLineString extends AbstractGeospatialType<Mul
     if (returnType.isAssignableFrom(MultiLineString.class)) {
       return returnType.cast(multiLineString);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -58,7 +57,6 @@ public final class EdmGeometryMultiLineString extends AbstractGeospatialType<Mul
       return toString((MultiLineString) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPoint.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPoint.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPoint.java
index 963b440..3fe9c97 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPoint.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPoint.java
@@ -44,10 +44,8 @@ public final class EdmGeometryMultiPoint extends AbstractGeospatialType<MultiPoi
     if (returnType.isAssignableFrom(MultiPoint.class)) {
       return returnType.cast(point);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
-
   }
 
   @Override
@@ -58,7 +56,6 @@ public final class EdmGeometryMultiPoint extends AbstractGeospatialType<MultiPoi
       return toString((MultiPoint) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPolygon.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPolygon.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPolygon.java
index b4bdd2d..1fee1b9 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPolygon.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryMultiPolygon.java
@@ -45,8 +45,7 @@ public final class EdmGeometryMultiPolygon extends AbstractGeospatialType<MultiP
     if (returnType.isAssignableFrom(MultiPolygon.class)) {
       return returnType.cast(multiPolygon);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -58,7 +57,6 @@ public final class EdmGeometryMultiPolygon extends AbstractGeospatialType<MultiP
       return toString((MultiPolygon) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPoint.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPoint.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPoint.java
index 6f00f83..5384abe 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPoint.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPoint.java
@@ -44,8 +44,7 @@ public final class EdmGeometryPoint extends AbstractGeospatialType<Point> {
     if (returnType.isAssignableFrom(Point.class)) {
       return returnType.cast(point);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -57,7 +56,6 @@ public final class EdmGeometryPoint extends AbstractGeospatialType<Point> {
       return toString((Point) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPolygon.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPolygon.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPolygon.java
index 68ff515..12924fc 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPolygon.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGeometryPolygon.java
@@ -44,8 +44,7 @@ public final class EdmGeometryPolygon extends AbstractGeospatialType<Polygon> {
     if (returnType.isAssignableFrom(Polygon.class)) {
       return returnType.cast(polygon);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -57,7 +56,6 @@ public final class EdmGeometryPolygon extends AbstractGeospatialType<Polygon> {
       return toString((Polygon) value, isNullable, maxLength, precision, scale, isUnicode);
     }
 
-    throw new EdmPrimitiveTypeException(
-        "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+    throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuid.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuid.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuid.java
index c62ea31..e188b5d 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuid.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmGuid.java
@@ -61,15 +61,13 @@ public final class EdmGuid extends SingletonPrimitiveType {
     if (validateLiteral(value)) {
       result = UUID.fromString(value);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)");
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.");
     }
 
     if (returnType.isAssignableFrom(UUID.class)) {
       return returnType.cast(result);
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType)");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.");
     }
   }
 
@@ -81,8 +79,7 @@ public final class EdmGuid extends SingletonPrimitiveType {
     if (value instanceof UUID) {
       return ((UUID) value).toString();
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16.java
index a34d1e1..eecbe73 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt16.java
@@ -55,18 +55,16 @@ public final class EdmInt16 extends SingletonPrimitiveType {
     try {
       valueShort = Short.parseShort(value);
     } catch (final NumberFormatException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e);
     }
 
     try {
       return EdmInt64.convertNumber(valueShort, returnType);
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+      throw new EdmPrimitiveTypeException("The literal '" + value
+          + "' cannot be converted to value type " + returnType + ".", e);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 
@@ -81,19 +79,16 @@ public final class EdmInt16 extends SingletonPrimitiveType {
           && ((Number) value).longValue() <= Short.MAX_VALUE) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else if (value instanceof BigInteger) {
       if (((BigInteger) value).bitLength() < Short.SIZE) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32.java
index eeadac9..6fef259 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt32.java
@@ -57,17 +57,16 @@ public final class EdmInt32 extends SingletonPrimitiveType {
     try {
       valueInteger = Integer.parseInt(value);
     } catch (final NumberFormatException e) {
-      throw new EdmPrimitiveTypeException("EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e);
     }
 
     try {
       return EdmInt64.convertNumber(valueInteger, returnType);
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+      throw new EdmPrimitiveTypeException("The literal '" + value
+          + "' cannot be converted to value type " + returnType + ".", e);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 
@@ -82,19 +81,16 @@ public final class EdmInt32 extends SingletonPrimitiveType {
       if ((Long) value >= Integer.MIN_VALUE && (Long) value <= Integer.MAX_VALUE) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else if (value instanceof BigInteger) {
       if (((BigInteger) value).bitLength() < Integer.SIZE) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64.java
index c2e9d9a..20d20e6 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmInt64.java
@@ -58,18 +58,16 @@ public final class EdmInt64 extends SingletonPrimitiveType {
     try {
       valueLong = Long.parseLong(value);
     } catch (final NumberFormatException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e);
     }
 
     try {
       return convertNumber(valueLong, returnType);
     } catch (final IllegalArgumentException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_UNCONVERTIBLE_TO_VALUE_TYPE.addContent(value, returnType), e");
+      throw new EdmPrimitiveTypeException("The literal '" + value
+          + "' cannot be converted to value type " + returnType + ".", e);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 
@@ -124,12 +122,10 @@ public final class EdmInt64 extends SingletonPrimitiveType {
       if (((BigInteger) value).bitLength() < Long.SIZE) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3ece19c9/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByte.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByte.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByte.java
index 0aacc01..42514d5 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByte.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmSByte.java
@@ -54,15 +54,13 @@ public final class EdmSByte extends SingletonPrimitiveType {
     try {
       valueByte = Byte.parseByte(value);
     } catch (final NumberFormatException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.LITERAL_ILLEGAL_CONTENT.addContent(value)", e);
+      throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content.", e);
     }
 
     try {
       return EdmInt64.convertNumber(valueByte, returnType);
     } catch (final ClassCastException e) {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(returnType), e");
+      throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported.", e);
     }
   }
 
@@ -77,19 +75,16 @@ public final class EdmSByte extends SingletonPrimitiveType {
       if (((Number) value).longValue() >= Byte.MIN_VALUE && ((Number) value).longValue() <= Byte.MAX_VALUE) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else if (value instanceof BigInteger) {
       if (((BigInteger) value).bitLength() < Byte.SIZE) {
         return value.toString();
       } else {
-        throw new EdmPrimitiveTypeException(
-            "EdmPrimitiveTypeException.VALUE_ILLEGAL_CONTENT.addContent(value)");
+        throw new EdmPrimitiveTypeException("The value '" + value + "' is not valid.");
       }
     } else {
-      throw new EdmPrimitiveTypeException(
-          "EdmPrimitiveTypeException.VALUE_TYPE_NOT_SUPPORTED.addContent(value.getClass())");
+      throw new EdmPrimitiveTypeException("The value type " + value.getClass() + " is not supported.");
     }
   }
 }