2929import java .util .Collection ;
3030import java .util .Collections ;
3131import java .util .List ;
32+ import java .util .Locale ;
3233
3334/**
3435 * Configuration options for benchmark servers.
@@ -69,7 +70,7 @@ protected Collection<Param> getParams() {
6970 protected ServerConfiguration build0 (ServerConfiguration config ) {
7071 if (config .tls && !config .transport .tlsSupported ) {
7172 throw new IllegalArgumentException (
72- "TLS unsupported with the " + config .transport . name (). toLowerCase () + " transport" );
73+ "TLS unsupported with the " + config .transport + " transport" );
7374 }
7475
7576 // Verify that the address type is correct for the transport type.
@@ -109,6 +110,11 @@ public enum Transport {
109110 this .socketAddressValidator = socketAddressValidator ;
110111 }
111112
113+ @ Override
114+ public String toString () {
115+ return name ().toLowerCase (Locale .ROOT );
116+ }
117+
112118 /**
113119 * Validates the given address for this transport.
114120 *
@@ -128,7 +134,7 @@ static String getDescriptionString() {
128134 if (!first ) {
129135 builder .append ("\n " );
130136 }
131- builder .append (transport . name (). toLowerCase () );
137+ builder .append (transport );
132138 builder .append (": " );
133139 builder .append (transport .description );
134140 first = false ;
@@ -158,10 +164,10 @@ protected void setServerValue(ServerConfiguration config, String value) {
158164 config .tls = parseBoolean (value );
159165 }
160166 },
161- TRANSPORT ("STR" , Transport .getDescriptionString (), DEFAULT .transport .name (). toLowerCase ()) {
167+ TRANSPORT ("STR" , Transport .getDescriptionString (), DEFAULT .transport .toString ()) {
162168 @ Override
163169 protected void setServerValue (ServerConfiguration config , String value ) {
164- config .transport = Transport .valueOf (value .toUpperCase ());
170+ config .transport = Transport .valueOf (value .toUpperCase (Locale . ROOT ));
165171 }
166172 },
167173 DIRECTEXECUTOR ("" , "Don't use a threadpool for RPC calls, instead execute calls directly "
@@ -197,7 +203,7 @@ protected void setServerValue(ServerConfiguration config, String value) {
197203
198204 @ Override
199205 public String getName () {
200- return name ().toLowerCase ();
206+ return name ().toLowerCase (Locale . ROOT );
201207 }
202208
203209 @ Override
0 commit comments