[OLINGO-1191]Fix null issue in Edm.String
This commit is contained in:
parent
6f8b90bccd
commit
4baf2b695a
|
@ -99,7 +99,10 @@ public final class EdmString extends SingletonPrimitiveType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String fromUriLiteral(final String literal) throws EdmPrimitiveTypeException {
|
||||
public String fromUriLiteral(String literal) throws EdmPrimitiveTypeException {
|
||||
if (literal != null && literal.equalsIgnoreCase("null")) {
|
||||
literal = "'" + literal + "'";
|
||||
}
|
||||
return literal == null ? null : super.fromUriLiteral(literal).replace("''", "'");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ public class EdmStringTest extends PrimitiveTypeBaseTest {
|
|||
@Test
|
||||
public void fromUriLiteral() throws Exception {
|
||||
assertEquals("String''Value", instance.fromUriLiteral("'String''''Value'"));
|
||||
assertEquals("null", instance.fromUriLiteral("null"));
|
||||
|
||||
expectErrorInFromUriLiteral(instance, "");
|
||||
expectErrorInFromUriLiteral(instance, "'");
|
||||
|
|
Loading…
Reference in New Issue