Program: 127035
Project: 127035
Buggy source:
/** 
 * Get the readable name (actual item display name) via context style name when the item is on context mode.<BR> Note that in order to make it easier for caller to get a name, this contextualName may be passed as an actual display name, in this case, this name will be simply returned.
 * @param dataManager
 * @param contextualName eigher the contextual name or the actual display name.
 * @return the readable actual item display name.
 */
public static String getReadableName(DataManager dataManager,String contextualName){
  if (contextualName == null) {
    log.error("String_Node_Str" + dataManager);
    return contextualName;
  }
  if (dataManager instanceof Connection && ((Connection)dataManager).isContextMode()) {
    Connection conn=(Connection)dataManager;
    String contextId=conn.getContextId();
    ContextItem contextItem=ContextUtils.getContextItemById2(contextId);
    ContextType contextType=ContextUtils.getContextTypeByName(contextItem,conn.getContextName(),false);
    if (contextType != null && ContextParameterUtils.isContainContextParam(contextualName)) {
      ContextParameterType param=null;
      for (      ContextParameterType paramType : (List<ContextParameterType>)contextType.getContextParameter()) {
        if (paramType.getName().equals(ContextParameterUtils.getVariableFromCode(contextualName))) {
          param=paramType;
          break;
        }
      }
      if (param != null) {
        String value2=param.getValue();
        if (value2 != null) {
          return value2;
        }
      }
    }
  }
  return contextualName;
}

Fixed version (ground truth):
/** 
 * Get the readable name (actual item display name) via context style name when the item is on context mode.<BR> Note that in order to make it easier for caller to get a name, this contextualName may be passed as an actual display name, in this case, this name will be simply returned.
 * @param dataManager
 * @param value eigher the contextual name or the actual display name.
 * @return the readable actual item display name.
 */
public static String getReadableName(DataManager dataManager,String value){
  if (!(dataManager instanceof Connection) || !((Connection)dataManager).isContextMode()) {
    return value;
  }
 else {
    if (value == null) {
      log.error("String_Node_Str" + dataManager);
      return value;
    }
    Connection conn=(Connection)dataManager;
    String contextId=conn.getContextId();
    ContextItem contextItem=ContextUtils.getContextItemById2(contextId);
    ContextType contextType=ContextUtils.getContextTypeByName(contextItem,conn.getContextName(),false);
    if (contextType != null && ContextParameterUtils.isContainContextParam(value)) {
      ContextParameterType param=null;
      for (      ContextParameterType paramType : (List<ContextParameterType>)contextType.getContextParameter()) {
        if (paramType.getName().equals(ContextParameterUtils.getVariableFromCode(value))) {
          param=paramType;
          break;
        }
      }
      if (param != null) {
        String value2=param.getValue();
        if (value2 != null) {
          return value2;
        }
      }
    }
    return value;
  }
}