Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] EnvironmentVariable and null values


I was looking for a bug and found that I had a null value in an environment var and that caused the problem. Because the environment variable (I'll call it MY_NULL=null) was referenced by another environment variable (I'll call it NULL_REF=${MY_NULL}) the following call failed

     envManager.getVariable("NULL_REF", configurationDescription, true);

but this was ok

     envManager.getVariable("NULL_REF", configurationDescription, false);

I can fix this but I don't know what the preferred solution would look like.

As the documentation is limited I wonder whether to fix it as "EnvironmentVariable does not support null values" or "EnvironmentVariable supports null values".

Please provide input on what the preferred solution would be

Best regards


PS: Note that there is also a bug in case of removed variables (which probably never happens but still).

        private void loadValue(IEnvironmentVariable var){
            String delimiter = var.getDelimiter();
String value = var.getOperation() != IEnvironmentVariable.ENVVAR_REMOVE ?
                    var.getValue() : null;


this because isTextList will create a exception when value is null.

Back to the top