when useSecureAPI config value is false, it is ignored #13

Closed
fourgablesguy opened this Issue Nov 6, 2013 · 0 comments

Projects

None yet

2 participants

@fourgablesguy

Workaround is that I must configure with
useSecureAPI = 'false'
If I use
useSecureAPI = false
the actual value used is set to true

Bug is in here

class ConfigHelper {
public static booleanValue(def value, boolean defaultValue) {
    if (!value) {
        return defaultValue
    }
    if (value.class == java.lang.Boolean) {
        // because 'true.toBoolean() == false' !!!
        return value
    } else {
        return value.toBoolean()
    }
}

should be

public static booleanValue(def value, boolean defaultValue) {
    if (value == null) {
        return defaultValue
    }
    if (value.class == java.lang.Boolean) {
        // because 'true.toBoolean() == false' !!!
        return value
    } else {
        return value.toBoolean()
    }
}
@iamthechad iamthechad was assigned Nov 6, 2013
@iamthechad iamthechad added a commit that referenced this issue Nov 7, 2013
@iamthechad Correctly parse config values.
Behave correctly for config values of "false", or when config value is
missing entirely. Refs #13
53e2ccf
@iamthechad iamthechad closed this Nov 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment