Changeset 1429

Show
Ignore:
Timestamp:
23/12/09 13:13:41 (3 months ago)
Author:
karel
Message:

Return empty string instead of 'null' if value is empty

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/core/kauri-runtime-rapi/src/main/java/org/kauriproject/runtime/rapi/ConfPlaceholderConfigurer.java

    r1058 r1429  
    2929            String confExpr = placeholder.substring(colonPos + 1); 
    3030 
    31  
    3231            Conf conf = confRegistry.getConfiguration(confPath); 
    3332            JXPathContext context = JXPathContext.newContext(conf); 
    34             String value = String.valueOf(context.getValue(confExpr)); 
     33            Object value = context.getValue(confExpr); 
    3534 
    36             return value
     35            return value == null ? "" : value.toString()
    3736        } catch (Exception e) { 
    3837            throw new RuntimeException("Error fetching configuration value for placeholder \"" + placeholder + "\".", e); 
    3938        } 
    4039    } 
     40  
    4141}