Program: 73013
Project: 73013
Buggy source:
/** 
 * Read a result file and return a matrix corresponding to the variables and size given.
 * @param fileName The executable result file of simulation in CSV format.
 * @param modelName Name of the model which should be built.
 * @return The value of the variables in the simulation file.
 * @throws ConnectException If commands couldn'tbe sent to the (OpenModelica Compiler)OMC. 
 * @throws IllegalActionException 
 */
public String displaySimulationResult(String fileName,String modelName) throws ConnectException, IllegalActionException {
  loadFile(fileName,modelName);
  CompilerResult readSimulationResultVars=sendCommand("String_Node_Str" + modelName + "String_Node_Str");
  String variableList=readSimulationResultVars.getFirstResult();
  StringBuffer variableBuffer=new StringBuffer(variableList);
  variableBuffer.deleteCharAt(0);
  variableList=variableBuffer.deleteCharAt(variableBuffer.length() - 1).toString();
  String[] variables=variableList.split("String_Node_Str");
  CompilerResult readSimulationResult=null;
  String simulationResult=null;
  for (  String variable : variables) {
    variableBuffer=new StringBuffer(variable.toString());
    variableBuffer.deleteCharAt(0);
    variableList=variableBuffer.deleteCharAt(variableBuffer.length() - 1).toString();
    if (variableList.compareTo("String_Node_Str") == 0)     variableList=variableBuffer.deleteCharAt(variableBuffer.length() - 1).toString();
    readSimulationResult=sendCommand("String_Node_Str" + modelName + "String_Node_Str"+ variableList+ "String_Node_Str"+ 2+ "String_Node_Str");
    if (simulationResult == null)     simulationResult="String_Node_Str" + variableList + "String_Node_Str"+ readSimulationResult.getFirstResult();
 else     simulationResult+="String_Node_Str" + variableList + "String_Node_Str"+ readSimulationResult.getFirstResult();
  }
  System.out.println(simulationResult);
  return simulationResult;
}

Fixed version (ground truth):
/** 
 * Read a result file and return a matrix corresponding to the variables and size given.
 * @param fileName The executable result file of simulation in CSV format.
 * @param modelName Name of the model which should be built.
 * @return The value of the variables in the simulation file.
 * @throws ConnectException If commands couldn'tbe sent to the (OpenModelica Compiler)OMC. 
 * @throws IllegalActionException 
 */
public String displaySimulationResult(String fileName,String modelName) throws ConnectException, IllegalActionException {
  CompilerResult readSimulationResultVars=sendCommand("String_Node_Str" + modelName + "String_Node_Str");
  String variableList=readSimulationResultVars.getFirstResult();
  StringBuffer variableBuffer=new StringBuffer(variableList);
  variableBuffer.deleteCharAt(0);
  variableList=variableBuffer.deleteCharAt(variableBuffer.length() - 1).toString();
  String[] variables=variableList.split("String_Node_Str");
  CompilerResult readSimulationResult=null;
  String simulationResult=null;
  for (  String variable : variables) {
    variableBuffer=new StringBuffer(variable.toString());
    variableBuffer.deleteCharAt(0);
    variableList=variableBuffer.deleteCharAt(variableBuffer.length() - 1).toString();
    if (variableList.compareTo("String_Node_Str") == 0)     variableList=variableBuffer.deleteCharAt(variableBuffer.length() - 1).toString();
    readSimulationResult=sendCommand("String_Node_Str" + modelName + "String_Node_Str"+ variableList+ "String_Node_Str"+ 2+ "String_Node_Str");
    if (simulationResult == null)     simulationResult="String_Node_Str" + variableList + "String_Node_Str"+ readSimulationResult.getFirstResult();
 else     simulationResult+="String_Node_Str" + variableList + "String_Node_Str"+ readSimulationResult.getFirstResult();
  }
  System.out.println(simulationResult);
  return simulationResult;
}