Program: 126884
Project: 126884
Buggy source:
public static String getContextTrueValue(DatabaseConnection conn,String paramValue){
  String trueSchemaName=null;
  String tempVlaue=paramValue;
  if (conn.isContextMode()) {
    if (conn.getContextId() != null && !"String_Node_Str".equals(conn.getContextId())) {
      String contextID=conn.getContextId();
      paramValue=ContextParameterUtils.getVariableFromCode(paramValue);
      IRepositoryViewObject repObj;
      try {
        repObj=ProxyRepositoryFactory.getInstance().getLastVersion(contextID);
        if (repObj != null && repObj.getProperty() != null && repObj.getProperty().getItem() instanceof ContextItem) {
          ContextItem contextItem=(ContextItem)repObj.getProperty().getItem();
          List list=contextItem.getContext();
          Iterator it=list.iterator();
          while (it.hasNext()) {
            Object o=it.next();
            if (o instanceof ContextType) {
              ContextType contextType=(ContextType)o;
              List contextList=contextType.getContextParameter();
              for (int i=0; i < contextList.size(); i++) {
                Object obj=contextList.get(i);
                if (obj instanceof ContextParameterType) {
                  ContextParameterType type=(ContextParameterType)obj;
                  if (type.getName().equals(paramValue)) {
                    if (type.getValue() == null) {
                      paramValue="String_Node_Str";
                    }
 else                     if ("String_Node_Str".equals(type.getValue())) {
                      paramValue=type.getValue();
                    }
 else {
                      paramValue=tempVlaue;
                    }
                    break;
                  }
                }
              }
            }
          }
        }
      }
 catch (      PersistenceException e1) {
        ExceptionHandler.process(e1);
      }
    }
  }
  trueSchemaName=paramValue;
  return trueSchemaName;
}

Fixed version (ground truth):
public static String getContextTrueValue(DatabaseConnection conn,String paramValue){
  String trueSchemaName=null;
  String tempVlaue=paramValue;
  if (conn.isContextMode()) {
    if (conn.getContextId() != null && !"String_Node_Str".equals(conn.getContextId())) {
      String contextID=conn.getContextId();
      paramValue=ContextParameterUtils.getVariableFromCode(paramValue);
      IRepositoryViewObject repObj;
      try {
        repObj=ProxyRepositoryFactory.getInstance().getLastVersion(contextID);
        if (repObj != null && repObj.getProperty() != null && repObj.getProperty().getItem() instanceof ContextItem) {
          ContextItem contextItem=(ContextItem)repObj.getProperty().getItem();
          List list=contextItem.getContext();
          Iterator it=list.iterator();
          while (it.hasNext()) {
            Object o=it.next();
            if (o instanceof ContextType) {
              ContextType contextType=(ContextType)o;
              List contextList=contextType.getContextParameter();
              for (int i=0; i < contextList.size(); i++) {
                Object obj=contextList.get(i);
                if (obj instanceof ContextParameterType) {
                  ContextParameterType type=(ContextParameterType)obj;
                  if (type.getName().equals(paramValue)) {
                    if (type.getValue() == null) {
                      paramValue="String_Node_Str";
                    }
 else {
                      paramValue=type.getValue();
                    }
                    break;
                  }
                }
              }
            }
          }
        }
      }
 catch (      PersistenceException e1) {
        ExceptionHandler.process(e1);
      }
    }
  }
  trueSchemaName=paramValue;
  return trueSchemaName;
}