@@ -34,6 +34,7 @@ public final class SdkUri {
34
34
35
35
private static final String HTTPS_PREFIX = "https://" ;
36
36
private static final String HTTP_PREFIX = "http://" ;
37
+ private static final int MAX_INT_DIGITS_BASE_10 = 10 ;
37
38
38
39
/*
39
40
* The default LRUCache size is 100, but for a single service call we cache at least 3 different URIs so the cache size is
@@ -91,7 +92,7 @@ public URI newUri(String scheme,
91
92
String userInfo , String host , int port ,
92
93
String path , String query , String fragment ) throws URISyntaxException {
93
94
if (!isAccountIdUri (host )) {
94
- log .trace (() -> "skipping cache for host" + host );
95
+ log .trace (() -> "skipping cache for host " + host );
95
96
return new URI (scheme , userInfo , host , port , path , query , fragment );
96
97
}
97
98
try {
@@ -112,7 +113,7 @@ public URI newUri(String scheme,
112
113
String authority ,
113
114
String path , String query , String fragment ) throws URISyntaxException {
114
115
if (!isAccountIdUri (authority )) {
115
- log .trace (() -> "skipping cache for authority" + authority );
116
+ log .trace (() -> "skipping cache for authority " + authority );
116
117
return new URI (scheme , authority , path , query , fragment );
117
118
}
118
119
try {
@@ -139,16 +140,15 @@ public URI newUri(String scheme,
139
140
*/
140
141
private boolean isAccountIdUri (String s ) {
141
142
int firstCharAfterScheme = 0 ;
142
- int maxIntSizeBase10 = 10 ;
143
143
if (s .startsWith (HTTPS_PREFIX )) {
144
144
firstCharAfterScheme = HTTPS_PREFIX .length ();
145
145
} else if (s .startsWith (HTTP_PREFIX )) {
146
146
firstCharAfterScheme = HTTP_PREFIX .length ();
147
147
}
148
148
149
- if (s .length () > firstCharAfterScheme + maxIntSizeBase10 ) {
149
+ if (s .length () > firstCharAfterScheme + MAX_INT_DIGITS_BASE_10 ) {
150
150
return Character .isDigit (s .charAt (firstCharAfterScheme ))
151
- && Character .isDigit (s .charAt (firstCharAfterScheme + maxIntSizeBase10 ));
151
+ && Character .isDigit (s .charAt (firstCharAfterScheme + MAX_INT_DIGITS_BASE_10 ));
152
152
}
153
153
return false ;
154
154
}
0 commit comments