SCS is setting defaulted=true for ConfigItems with empty default values

Description

When SCS is looking up a property with

public String getString(String name) {
return getString(name, ""); //properties);
}

Its passing an empty default value which is later misused by

ConfigItemImpl findConfigItem(String name, Object defaultValue)

which sets defaulted to true even when defaultValue is an empty String for a known ConfigItem.

Attached is a patch removing setting defaulted to true for a known ConfigItem.

This seemed more reasonable than updating the existing ConfigItem.

Attachments

2

Activity

Show:

Hudson CI Server October 18, 2013 at 3:53 PM

Integrated in kernel-trunk #728 (See http://builds.sakaiproject.org:8080/job/kernel-trunk/728/)
ePE discovered where value can now be null (Revision 130631)

Result = SUCCESS

Earle Nietzel October 18, 2013 at 2:07 PM
Edited

I believe before this patch all values would have received a blank default, which was then returned later on. Essentially would never return a null value.

Earle Nietzel October 18, 2013 at 2:05 PM
Edited

Reversed merged 130621 to open new jira and put fix there.

Hudson CI Server October 18, 2013 at 1:43 PM

Integrated in kernel-trunk #727 (See http://builds.sakaiproject.org:8080/job/kernel-trunk/727/)
NPE discovered where value can now be null (Revision 130621)

Result = SUCCESS

Aaron Zeckoski October 18, 2013 at 1:09 PM

Also... just looking at the change which is these 3 lines:
if (ServerConfigurationService.TYPE_STRING.equals(ci.type)) {
ci.defaulted = !(defaultValue == null || "".equals(defaultValue));
} else if (defaultValue != null) {

I don't see where that could possibly generate a NPE unless ci is null but the line above this refers to ci.requested() so that would have died before this. What am I missing?

Fixed

Details

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Created October 15, 2013 at 4:11 PM
Updated April 25, 2018 at 3:19 PM
Resolved October 16, 2013 at 7:12 AM