Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
default value should be null
Browse files Browse the repository at this point in the history
  • Loading branch information
imaffe committed Jan 3, 2023
1 parent db9015b commit 4cda499
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -655,20 +655,20 @@ private void validateRequiredConfigs() {
*/
private void useDefaultValueIfBothFileAndJCommanderNotProvided() {

jarFile = useSecondIfFirstIsNull(jarFile, "");
transformFunctionJarFile = useSecondIfFirstIsNull(transformFunctionJarFile, "");
transformFunctionId = useSecondIfFirstIsNull(transformFunctionId, "");
clientAuthenticationPlugin = useSecondIfFirstIsNull(clientAuthenticationPlugin, "");
clientAuthenticationParameters = useSecondIfFirstIsNull(clientAuthenticationParameters, "");
tlsTrustCertFilePath = useSecondIfFirstIsNull(tlsTrustCertFilePath, "");
stateStorageImplClass = useSecondIfFirstIsNull(stateStorageImplClass, "");
stateStorageServiceUrl = useSecondIfFirstIsNull(stateStorageServiceUrl, "");
secretsProviderClassName = useSecondIfFirstIsNull(secretsProviderClassName, "");
secretsProviderConfig = useSecondIfFirstIsNull(secretsProviderConfig, "");
// jarFile = useSecondIfFirstIsNull(jarFile, "");
// transformFunctionJarFile = useSecondIfFirstIsNull(transformFunctionJarFile, "");
// transformFunctionId = useSecondIfFirstIsNull(transformFunctionId, "");
// clientAuthenticationPlugin = useSecondIfFirstIsNull(clientAuthenticationPlugin, "");
// clientAuthenticationParameters = useSecondIfFirstIsNull(clientAuthenticationParameters, "");
// tlsTrustCertFilePath = useSecondIfFirstIsNull(tlsTrustCertFilePath, "");
// stateStorageImplClass = useSecondIfFirstIsNull(stateStorageImplClass, "");
// stateStorageServiceUrl = useSecondIfFirstIsNull(stateStorageServiceUrl, "");
// secretsProviderClassName = useSecondIfFirstIsNull(secretsProviderClassName, "");
// secretsProviderConfig = useSecondIfFirstIsNull(secretsProviderConfig, "");
narExtractionDirectory = useSecondIfFirstIsNull(
narExtractionDirectory,
NarClassLoader.DEFAULT_NAR_EXTRACTION_DIR);
webServiceUrl = useSecondIfFirstIsNull(webServiceUrl, null);
// webServiceUrl = useSecondIfFirstIsNull(webServiceUrl, null);

// Integer
maxPendingAsyncRequests = useSecondIfFirstIsNull(maxPendingAsyncRequests, 1000);
Expand All @@ -684,7 +684,6 @@ private void useDefaultValueIfBothFileAndJCommanderNotProvided() {
}



// TODO this method can be replaced with requireNonNullElse() after Java 9.
private <T> T useSecondIfFirstIsNull(T valueToTest, T valueIfNull) {
if (Objects.isNull(valueToTest)) {
Expand Down Expand Up @@ -715,7 +714,7 @@ protected void setConfigs(String[] args) throws IOException{

// completeConfigFromFileIfCmdArgNotProvided();
validateRequiredConfigs();
// useDefaultValueIfBothFileAndJCommanderNotProvided();
useDefaultValueIfBothFileAndJCommanderNotProvided();
}

protected static Set<String> requireConfigFieldsNames = new HashSet<>(){{
Expand Down

0 comments on commit 4cda499

Please sign in to comment.