Azure / Azure/azure-documentdb-java
Cannot set a Date typed value to property for Document
- Linguagem predominante
- Java
- Estrelas
- 51
- Forks
- 52
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Not sure whether this is a bug or it's a must follow rule to use the Document.
SDK version: `1.15.2`
Suppose a POJO class with Date typed field:
```java
class MyPojo {
private String id;
private Date date;
// .. others omitted
}
```
Create a Document and configure the property value.
```java
Document document = new Document();
document.set("date", new Date()); // Exception will be thrown as Date cannot be handled, trace below
....
```
Exception trace:
```
A JSONObject text must begin with '{' at 1 [character 2 line 1]
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:433)
at org.json.JSONObject.(JSONObject.java:194)
at org.json.JSONObject.(JSONObject.java:321)
at com.microsoft.azure.documentdb.JsonSerializable.set(JsonSerializable.java:213)
```
Guia de contribuição
Direção de pesquisa
Reproduza a atribuição de Date em Document e inspecione JsonSerializable.java por volta da linha 213, onde o stack trace mostra a falha. Determine se os valores Date devem ser aceitos por Document.set; considera-se concluído quando o comportamento tiver sido resolvido ou claramente estabelecido com um teste de regressão ou uma limitação documentada.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- databases
- Tipo de issue
- Bug
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100