@@ -62,7 +62,7 @@ public class RegistrationRequest {
62
62
63
63
private String [] args ;
64
64
65
- private static final Logger log = Logger .getLogger (RegistrationRequest .class .getName ());
65
+ private static final Logger LOG = Logger .getLogger (RegistrationRequest .class .getName ());
66
66
67
67
// some special param for capability
68
68
public static final String APP = "applicationName" ;
@@ -195,8 +195,10 @@ public int getConfigAsInt(String param, int defaultValue) {
195
195
}
196
196
try {
197
197
return Integer .parseInt (o .toString ());
198
- } catch (Throwable t ) {
199
- log .warning ("Error. " + param + " is supposed to be an int. Keeping default of " + defaultValue );
198
+ } catch (NumberFormatException t ) {
199
+ LOG .warning (String .format (
200
+ "Parameter %s has value '%s', but it is supposed to be an int. Keeping default of %s" ,
201
+ param , o , defaultValue ));
200
202
return defaultValue ;
201
203
}
202
204
@@ -321,7 +323,7 @@ private static RegistrationRequest parseGrid1Request(String clientRequest) {
321
323
registrationInfo .put (URLDecoder .decode (configItem [0 ], "UTF-8" ),
322
324
URLDecoder .decode (configItem [1 ], "UTF-8" ));
323
325
} catch (UnsupportedEncodingException e ) {
324
- log .warning (String .format ("Unable to decode registration request portion: %s" , part ));
326
+ LOG .warning (String .format ("Unable to decode registration request portion: %s" , part ));
325
327
}
326
328
}
327
329
@@ -499,7 +501,7 @@ private void loadFromCommandLine(String[] args) {
499
501
}
500
502
501
503
private DesiredCapabilities addCapabilityFromString (String capability ) {
502
- log .info ("Adding " + capability );
504
+ LOG .info ("Adding " + capability );
503
505
String [] s = capability .split ("," );
504
506
if (s .length == 0 ) {
505
507
throw new GridConfigurationException ("-browser must be followed by a browser description" );
0 commit comments