diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java index a63010b7f..8e9a42a59 100644 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmString.java @@ -21,8 +21,6 @@ package org.apache.olingo.commons.core.edm.primitivetype; import java.util.regex.Pattern; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; -import org.apache.olingo.commons.core.Decoder; -import org.apache.olingo.commons.core.Encoder; /** * Implementation of the EDM primitive type String. @@ -97,11 +95,11 @@ public final class EdmString extends SingletonPrimitiveType { uriLiteral.append(c); } uriLiteral.append(uriSuffix); - return Encoder.encode(uriLiteral.toString()); + return uriLiteral.toString(); } @Override public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException { - return literal == null ? null : Decoder.decode(super.fromUriLiteral(literal).replace("''", "'")); + return literal == null ? null : super.fromUriLiteral(literal).replace("''", "'"); } } diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java index 1035e6b43..b5f2a89d5 100644 --- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java +++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/primitivetype/EdmStringTest.java @@ -33,13 +33,11 @@ public class EdmStringTest extends PrimitiveTypeBaseTest { assertEquals("'StringValue'", instance.toUriLiteral("StringValue")); assertEquals("'String''Value'", instance.toUriLiteral("String'Value")); assertEquals("'String''''''Value'", instance.toUriLiteral("String'''Value")); - assertEquals("'ab%20cd%20'", instance.toUriLiteral("ab cd ")); } @Test public void fromUriLiteral() throws Exception { assertEquals("String''Value", instance.fromUriLiteral("'String''''Value'")); - assertEquals("ab cd ", instance.fromUriLiteral("'ab%20cd%20'")); expectErrorInFromUriLiteral(instance, ""); expectErrorInFromUriLiteral(instance, "'");