29
29
import java .util .Collection ;
30
30
import java .util .Collections ;
31
31
import java .util .List ;
32
+ import java .util .Locale ;
32
33
33
34
/**
34
35
* Configuration options for benchmark servers.
@@ -69,7 +70,7 @@ protected Collection<Param> getParams() {
69
70
protected ServerConfiguration build0 (ServerConfiguration config ) {
70
71
if (config .tls && !config .transport .tlsSupported ) {
71
72
throw new IllegalArgumentException (
72
- "TLS unsupported with the " + config .transport . name (). toLowerCase () + " transport" );
73
+ "TLS unsupported with the " + config .transport + " transport" );
73
74
}
74
75
75
76
// Verify that the address type is correct for the transport type.
@@ -109,6 +110,11 @@ public enum Transport {
109
110
this .socketAddressValidator = socketAddressValidator ;
110
111
}
111
112
113
+ @ Override
114
+ public String toString () {
115
+ return name ().toLowerCase (Locale .ROOT );
116
+ }
117
+
112
118
/**
113
119
* Validates the given address for this transport.
114
120
*
@@ -128,7 +134,7 @@ static String getDescriptionString() {
128
134
if (!first ) {
129
135
builder .append ("\n " );
130
136
}
131
- builder .append (transport . name (). toLowerCase () );
137
+ builder .append (transport );
132
138
builder .append (": " );
133
139
builder .append (transport .description );
134
140
first = false ;
@@ -158,10 +164,10 @@ protected void setServerValue(ServerConfiguration config, String value) {
158
164
config .tls = parseBoolean (value );
159
165
}
160
166
},
161
- TRANSPORT ("STR" , Transport .getDescriptionString (), DEFAULT .transport .name (). toLowerCase ()) {
167
+ TRANSPORT ("STR" , Transport .getDescriptionString (), DEFAULT .transport .toString ()) {
162
168
@ Override
163
169
protected void setServerValue (ServerConfiguration config , String value ) {
164
- config .transport = Transport .valueOf (value .toUpperCase ());
170
+ config .transport = Transport .valueOf (value .toUpperCase (Locale . ROOT ));
165
171
}
166
172
},
167
173
DIRECTEXECUTOR ("" , "Don't use a threadpool for RPC calls, instead execute calls directly "
@@ -197,7 +203,7 @@ protected void setServerValue(ServerConfiguration config, String value) {
197
203
198
204
@ Override
199
205
public String getName () {
200
- return name ().toLowerCase ();
206
+ return name ().toLowerCase (Locale . ROOT );
201
207
}
202
208
203
209
@ Override
0 commit comments