mirror of https://github.com/grpc/grpc-java.git
core: fix floating-point number formatting Locale (#7473)
This commit is contained in:
parent
80631db7a8
commit
654f7c3dc6
|
@ -17,6 +17,7 @@
|
|||
package io.grpc;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -206,7 +207,7 @@ public final class Deadline implements Comparable<Deadline> {
|
|||
}
|
||||
buf.append(seconds);
|
||||
if (nanos > 0) {
|
||||
buf.append(String.format(".%09d", nanos));
|
||||
buf.append(String.format(Locale.US, ".%09d", nanos));
|
||||
}
|
||||
buf.append("s from now");
|
||||
if (ticker != SYSTEM_TICKER) {
|
||||
|
|
|
@ -54,6 +54,7 @@ import io.perfmark.PerfMark;
|
|||
import io.perfmark.Tag;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
@ -441,7 +442,7 @@ final class ClientCallImpl<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
|||
buf.append('-');
|
||||
}
|
||||
buf.append(seconds);
|
||||
buf.append(String.format(".%09d", nanos));
|
||||
buf.append(String.format(Locale.US, ".%09d", nanos));
|
||||
buf.append("s. ");
|
||||
buf.append(insight);
|
||||
stream.cancel(DEADLINE_EXCEEDED.augmentDescription(buf.toString()));
|
||||
|
|
|
@ -30,6 +30,7 @@ import io.grpc.Metadata;
|
|||
import io.grpc.Status;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
@ -117,7 +118,7 @@ class DelayedClientCall<ReqT, RespT> extends ClientCall<ReqT, RespT> {
|
|||
buf.append("Deadline exceeded after ");
|
||||
}
|
||||
buf.append(seconds);
|
||||
buf.append(String.format(".%09d", nanos));
|
||||
buf.append(String.format(Locale.US, ".%09d", nanos));
|
||||
buf.append("s. ");
|
||||
/** Cancels the call if deadline exceeded prior to the real call being set. */
|
||||
class DeadlineExceededRunnable implements Runnable {
|
||||
|
|
Loading…
Reference in New Issue