import com.google.protobuf.Message;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
+import java.nio.charset.StandardCharsets;
import javax.annotation.Nullable;
import org.apache.commons.io.IOUtils;
import org.sonar.api.server.ws.Request;
msg.writeTo(output);
} else {
response.stream().setMediaType(MediaTypes.JSON);
- try (OutputStreamWriter writer = new OutputStreamWriter(output)) {
+ try (OutputStreamWriter writer = new OutputStreamWriter(output, StandardCharsets.UTF_8)) {
ProtobufJsonFormat.write(msg, JsonWriter.of(writer));
}
}
*/
package org.sonar.api.utils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import org.apache.commons.lang.builder.ToStringStyle;
-
-import javax.annotation.Nullable;
-
import java.io.Serializable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import javax.annotation.Nullable;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ToStringStyle;
/**
* @since 4.3
}
private Duration(int days, int hours, int minutes, int hoursInDay) {
- this((days * hoursInDay * MINUTES_IN_ONE_HOUR) + (hours * MINUTES_IN_ONE_HOUR) + minutes);
+ this(((long) days * hoursInDay * MINUTES_IN_ONE_HOUR) + (hours * MINUTES_IN_ONE_HOUR) + minutes);
}
/**