Skip to content

Commit df94d89

Browse files
committed
chore(CredentialUtils): Fix a million misspellings of JNDI
1 parent a8d9a50 commit df94d89

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/main/java/com/ibm/cloud/sdk/core/util/CredentialUtils.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static boolean hasBadStartOrEndChar(String credentialValue) {
174174

175175
/**
176176
* Calls methods to parse VCAP_SERVICES and retrieve credential values. For some values, if VCAP_SERVICES aren't
177-
* present, it'll fall back to checking JDNI.
177+
* present, it'll fall back to checking JNDI.
178178
*
179179
* @param serviceName the service name
180180
* @return ServiceCredentials object containing parsed values
@@ -184,12 +184,12 @@ public static ServiceCredentials getCredentialsFromVcap(String serviceName) {
184184
String password = getVcapValue(serviceName, PASSWORD);
185185
String oldApiKey = getVcapValue(serviceName, OLD_APIKEY);
186186
if (username == null && password == null && oldApiKey == null) {
187-
oldApiKey = getJdniValue(serviceName, LOOKUP_NAME_EXTENSION_API_KEY);
187+
oldApiKey = getJndiValue(serviceName, LOOKUP_NAME_EXTENSION_API_KEY);
188188
}
189189

190190
String url = getVcapValue(serviceName, URL);
191191
if (url == null) {
192-
url = getJdniValue(serviceName, LOOKUP_NAME_EXTENSION_URL);
192+
url = getJndiValue(serviceName, LOOKUP_NAME_EXTENSION_URL);
193193
}
194194

195195
String iamApiKey = getVcapValue(serviceName, IAM_APIKEY);
@@ -199,26 +199,26 @@ public static ServiceCredentials getCredentialsFromVcap(String serviceName) {
199199
}
200200

201201
/**
202-
* Builds the lookup name to be searched for in JDNI
203-
* and uses it to call the overloaded JDNI method.
202+
* Builds the lookup name to be searched for in JNDI
203+
* and uses it to call the overloaded JNDI method.
204204
*
205205
* @param serviceName Name of the bluemix service
206-
* @param lookupNameExtension Extension to determine which value should be retrieved through JDNI
206+
* @param lookupNameExtension Extension to determine which value should be retrieved through JNDI
207207
* @return The encoded desired value
208208
*/
209-
private static String getJdniValue(String serviceName, String lookupNameExtension) {
210-
return getJdniValue("watson-developer-cloud/" + serviceName + lookupNameExtension);
209+
private static String getJndiValue(String serviceName, String lookupNameExtension) {
210+
return getJndiValue("watson-developer-cloud/" + serviceName + lookupNameExtension);
211211
}
212212

213213
/**
214214
* Attempt to get the Base64-encoded value through JNDI.
215215
*
216216
* This method should always return null on Android due to the javax functions being unsupported
217217
*
218-
* @param lookupName Key to lookup in JDNI
218+
* @param lookupName Key to lookup in JNDI
219219
* @return The encoded desired value
220220
*/
221-
private static String getJdniValue(String lookupName) {
221+
private static String getJndiValue(String lookupName) {
222222
if (!isClassAvailable("javax.naming.Context") || !isClassAvailable("javax.naming.InitialContext")) {
223223
log.info("JNDI string lookups is not available.");
224224
return null;
@@ -297,7 +297,7 @@ public static String getVcapValue(String serviceName, String key) {
297297

298298
/**
299299
* Returns the value associated with the provided key from the VCAP_SERVICES, or null if it doesn't exist. In the
300-
* case of the API URL, if VCAP_SERVICES aren't present, this method will also search in JDNI.
300+
* case of the API URL, if VCAP_SERVICES aren't present, this method will also search in JNDI.
301301
*
302302
* @param serviceName the service name
303303
* @param key the key whose value should be returned
@@ -333,15 +333,15 @@ public static void setServices(String services) {
333333
}
334334

335335
/**
336-
* Sets the context variable for JDNI. This is a utility method for testing.
336+
* Sets the context variable for JNDI. This is a utility method for testing.
337337
*
338338
* @param env Configuration options for the context
339339
*/
340340
public static void setContext(Hashtable<String, String> env) {
341341
try {
342342
CredentialUtils.context = new InitialContext(env);
343343
} catch (Exception e) {
344-
log.fine("Error setting up JDNI context: " + e.getMessage());
344+
log.fine("Error setting up JNDI context: " + e.getMessage());
345345
}
346346
}
347347

0 commit comments

Comments
 (0)