*/
package org.sonar.server.activity.index;
+import org.apache.commons.io.Charsets;
import org.apache.commons.lang.StringUtils;
import org.elasticsearch.action.update.UpdateRequest;
import org.sonar.api.utils.KeyValueFormat;
protected UpdateRequest read(ResultSet rs) throws SQLException {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
// all the fields must be present, even if value is null
- JsonWriter writer = JsonWriter.of(new OutputStreamWriter(bytes)).setSerializeNulls(true);
+ JsonWriter writer = JsonWriter.of(new OutputStreamWriter(bytes, Charsets.UTF_8)).setSerializeNulls(true);
writer.beginObject();
String key = rs.getString(1);
writer.prop(ActivityIndexDefinition.FIELD_KEY, key);
*/
package org.sonar.server.source.index;
+import org.apache.commons.io.Charsets;
import org.apache.commons.lang.StringUtils;
import org.elasticsearch.action.update.UpdateRequest;
import org.sonar.api.utils.text.JsonWriter;
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
// all the fields must be present, even if value is null
- JsonWriter writer = JsonWriter.of(new OutputStreamWriter(bytes)).setSerializeNulls(true);
+ JsonWriter writer = JsonWriter.of(new OutputStreamWriter(bytes, Charsets.UTF_8)).setSerializeNulls(true);
writer.beginObject();
writer.prop(SourceLineIndexDefinition.FIELD_PROJECT_UUID, projectUuid);
writer.prop(SourceLineIndexDefinition.FIELD_FILE_UUID, fileUuid);
@Test
public void max() throws Exception {
collector.add(DateUtils.parseDate("2013-06-01"));
+ collector.add(null);
collector.add(DateUtils.parseDate("2014-01-01"));
collector.add(DateUtils.parseDate("2013-08-01"));