azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

ApplicationTokenCredentials constructor argument not behaving as documented

Open marcosadp opened this issue 9 years ago • 1 comments

Based on the documentation for ApplicationTokenCredentials, the constructor argument environment should default to AzureEnvironment.AZURE if null is provided.

Reference: https://azure.github.io/azure-sdk-for-java/com/microsoft/azure/credentials/ApplicationTokenCredentials.html#ApplicationTokenCredentials-java.lang.String-java.lang.String-java.lang.String-com.microsoft.azure.AzureEnvironment-

However, if null is passed to the constructor, the following exception is thrown:

Exception in thread "main" java.lang.NullPointerException at com.microsoft.azure.RestClient$Builder.withBaseUrl(RestClient.java:209) at com.microsoft.azure.management.resources.fluentcore.arm.implementation.AzureConfigurableImpl.buildRestClient(AzureConfigurableImpl.java:99) at com.microsoft.azure.management.resources.fluentcore.arm.implementation.AzureConfigurableImpl.buildRestClient(AzureConfigurableImpl.java:104) at com.microsoft.azure.management.Azure$ConfigurableImpl.authenticate(Azure.java:170)

marcosadp avatar Dec 20 '16 00:12 marcosadp

I just realized this class is a dependency that belongs to another project.

marcosadp avatar Dec 20 '16 01:12 marcosadp