Program: 122676
Project: 122676
Buggy source:
public palocube createCube(String strCubeName,String[] strArrDimensions,int iType) throws paloexception {
  palodimensions plDIMs=plDB.getDimensions(iType);
  StringBuilder sbDimensionsToCreate=new StringBuilder();
  int iPos=0;
  for (  String strDimensionName : strArrDimensions) {
    if (iPos > 0)     sbDimensionsToCreate.append("String_Node_Str");
    palodimension plDIM=plDIMs.getDimension(strDimensionName);
    if (null == plDIM)     sbDimensionsToCreate.append("String_Node_Str");
 else     sbDimensionsToCreate.append(plDIMs.getDimension(strDimensionName).getDimensionId());
    iPos++;
  }
  List<NameValuePair> qparams=new ArrayList<NameValuePair>();
  qparams.add(new BasicNameValuePair("String_Node_Str",this.plConn.getPaloToken()));
  qparams.add(new BasicNameValuePair("String_Node_Str",String.valueOf(this.plDB.getDatabaseId())));
  qparams.add(new BasicNameValuePair("String_Node_Str",strCubeName));
  qparams.add(new BasicNameValuePair("String_Node_Str",String.valueOf(iType)));
  qparams.add(new BasicNameValuePair("String_Node_Str",sbDimensionsToCreate.toString()));
  try {
    palocube plCube=null;
    HttpEntity entity=this.plConn.sendToServer(qparams,"String_Node_Str");
    CsvReader csv=new CsvReader(entity.getContent(),Charset.forName("String_Node_Str"));
    csv.setDelimiter(';');
    csv.setTextQualifier('"');
    while (csv.readRecord()) {
      plCube=new palocube(plConn,plDB.getDatabaseId(),palohelpers.StringToInt(csv.get(0)),csv.get(1),palohelpers.StringToInt(csv.get(2)),palohelpers.StringToIntArray(csv.get(3),palohelpers.StringToInt(csv.get(2))),palohelpers.StringToLong(csv.get(4)),palohelpers.StringToLong(csv.get(5)),palohelpers.StringToInt(csv.get(6)),palohelpers.StringToInt(csv.get(7)),palohelpers.StringToInt(csv.get(8)));
      paloCubes.add(plCube);
    }
    csv.close();
    entity.consumeContent();
    return plCube;
  }
 catch (  Exception e) {
    throw new paloexception(e.getMessage());
  }
}

Fixed version (ground truth):
public palocube createCube(String strCubeName,String[] strArrDimensions,int iType) throws paloexception {
  palodimensions plDIMs=plDB.getDimensions(iType);
  StringBuilder sbDimensionsToCreate=new StringBuilder();
  int iPos=0;
  for (  String strDimensionName : strArrDimensions) {
    if (iPos > 0) {
      sbDimensionsToCreate.append("String_Node_Str");
    }
    palodimension plDIM=plDIMs.getDimension(strDimensionName);
    if (null == plDIM) {
      sbDimensionsToCreate.append("String_Node_Str");
    }
 else {
      sbDimensionsToCreate.append(plDIMs.getDimension(strDimensionName).getDimensionId());
    }
    iPos++;
  }
  List<NameValuePair> qparams=new ArrayList<NameValuePair>();
  qparams.add(new BasicNameValuePair("String_Node_Str",this.plConn.getPaloToken()));
  qparams.add(new BasicNameValuePair("String_Node_Str",String.valueOf(this.plDB.getDatabaseId())));
  qparams.add(new BasicNameValuePair("String_Node_Str",strCubeName));
  qparams.add(new BasicNameValuePair("String_Node_Str",String.valueOf(iType)));
  qparams.add(new BasicNameValuePair("String_Node_Str",sbDimensionsToCreate.toString()));
  try {
    palocube plCube=null;
    HttpEntity entity=this.plConn.sendToServer(qparams,"String_Node_Str");
    CSVReader csv=new CSVReader(entity.getContent(),"String_Node_Str","String_Node_Str",';','"','\\',false,0);
    String[] result=null;
    while ((result=csv.readNext()) != null) {
      plCube=new palocube(plConn,plDB.getDatabaseId(),palohelpers.StringToInt(result[0]),result[1],palohelpers.StringToInt(result[2]),palohelpers.StringToIntArray(result[3],palohelpers.StringToInt(result[2])),palohelpers.StringToLong(result[4]),palohelpers.StringToLong(result[5]),palohelpers.StringToInt(result[6]),palohelpers.StringToInt(result[7]),palohelpers.StringToInt(result[8]));
      paloCubes.add(plCube);
    }
    csv.close();
    entity.consumeContent();
    return plCube;
  }
 catch (  Exception e) {
    throw new paloexception(e.getMessage());
  }
}