Program: 59087
Project: 59087
Buggy source:
protected int loadDataParseFile(BufferedReader brFile,final int iNumberOfLinesInFile) throws IOException {
  allocateStorageBufferForTokenPattern();
  ListIterator<ParserTokenHandler> iterForAllocationInit=alTokenTargetToParserTokenType.listIterator();
  ParserTokenHandler bufferAllocationTokenInit;
  Vector<StorageType> vecBuffersTorage=new Vector<StorageType>();
  progressBarSetStoreInitTitle("String_Node_Str" + this.getFileName(),0,alTargetStorages.size());
  for (  IStorage tmpStorage : alTargetStorages) {
    boolean bStayInLoop=true;
    while ((iterForAllocationInit.hasNext()) && (bStayInLoop)) {
      bufferAllocationTokenInit=iterForAllocationInit.next();
switch (bufferAllocationTokenInit.getType()) {
case INT:
        tmpStorage.setSize(StorageType.INT,iNumberOfLinesInFile);
      vecBuffersTorage.addElement(StorageType.INT);
    bStayInLoop=false;
  break;
case FLOAT:
tmpStorage.setSize(StorageType.FLOAT,iNumberOfLinesInFile);
vecBuffersTorage.addElement(StorageType.FLOAT);
bStayInLoop=false;
break;
case STRING:
tmpStorage.setSize(StorageType.STRING,iNumberOfLinesInFile);
vecBuffersTorage.addElement(StorageType.STRING);
bStayInLoop=false;
break;
default :
}
}
}
Vector<String> vecBufferText=new Vector<String>(10);
StringBuffer strLineBuffer=new StringBuffer();
String sLine;
int lineInFile=0;
int lineInFile_CurrentDataIndex=0;
while (((sLine=brFile.readLine()) != null) && (lineInFile <= iStopParsingAtLine)) {
if (lineInFile >= this.iStartParsingAtLine) {
boolean bMaintainLoop=true;
StringTokenizer strTokenText=new StringTokenizer(sLine,"String_Node_Str");
strLineBuffer.setLength(0);
vecBufferText.clear();
int iCountTokens=strTokenText.countTokens();
if ((iCountTokens % 2) == 0) {
strTokenText=new StringTokenizer(sLine.replace("String_Node_Str","String_Node_Str"),"String_Node_Str");
}
if (iCountTokens > 1) {
strLineBuffer.append(strTokenText.nextToken());
boolean bToggle_Buffer=true;
while (strTokenText.hasMoreTokens()) {
String sBuffer=strTokenText.nextToken().trim();
if (bToggle_Buffer) {
vecBufferText.addElement(sBuffer);
strLineBuffer.append(sBuffer);
strLineBuffer.append("String_Node_Str");
bToggle_Buffer=false;
}
 else {
strLineBuffer.append(sBuffer);
bToggle_Buffer=true;
}
}
}
 else {
strLineBuffer.append(sLine);
}
StringTokenizer strToken=new StringTokenizer(new String(strLineBuffer));
ListIterator<ParserTokenHandler> iterPerLine=alTokenTargetToParserTokenType.listIterator();
int iDataArrayIndexPerLine=0;
ParserTokenHandler bufferIter=null;
while ((strToken.hasMoreTokens()) && (bMaintainLoop)) {
String sTokenObject=strToken.nextToken();
String[] bufferStringArray=null;
try {
bufferIter=iterPerLine.next();
switch (bufferIter.getType()) {
case ABORT:
bMaintainLoop=false;
break;
case INT:
int[] bufferIntArray=alTargetStorages.get(iDataArrayIndexPerLine).getArrayInt();
if (bufferIntArray == null) {
generalManager.getLogger().log(Level.SEVERE,"String_Node_Str");
break;
}
bufferIntArray[lineInFile_CurrentDataIndex]=new Integer(sTokenObject);
iDataArrayIndexPerLine++;
break;
case FLOAT:
float[] bufferFloatArray=alTargetStorages.get(iDataArrayIndexPerLine).getArrayFloat();
bufferFloatArray[lineInFile_CurrentDataIndex]=new Float(sTokenObject);
iDataArrayIndexPerLine++;
break;
case STRING:
bufferStringArray=alTargetStorages.get(iDataArrayIndexPerLine).getArrayString();
if (bufferStringArray == null) {
generalManager.getLogger().log(Level.SEVERE,"String_Node_Str");
break;
}
bufferStringArray[lineInFile_CurrentDataIndex]=sTokenObject;
if (bufferStringArray.length > iDataArrayIndexPerLine) {
iDataArrayIndexPerLine++;
}
 else {
System.err.println("String_Node_Str" + lineInFile_CurrentDataIndex + "String_Node_Str"+ iDataArrayIndexPerLine+ "String_Node_Str"+ bufferStringArray[lineInFile_CurrentDataIndex]+ "String_Node_Str");
;
}
iDataArrayIndexPerLine++;
break;
case SKIP:
break;
default :
System.err.println("String_Node_Str");
}
}
 catch (NoSuchElementException nsee) {
bMaintainLoop=false;
}
catch (NumberFormatException nfe) {
if (bufferIter == null) {
}
 else {
}
}
catch (ArrayIndexOutOfBoundsException aie) {
String info="String_Node_Str" + lineInFile_CurrentDataIndex + "String_Node_Str";
if (bufferStringArray != null) {
info+=bufferStringArray.toString();
}
 else {
info+="String_Node_Str";
}
info+="String_Node_Str" + aie.toString();
System.out.println("String_Node_Str" + iDataArrayIndexPerLine + "String_Node_Str"+ aie.toString());
iDataArrayIndexPerLine++;
}
}
lineInFile_CurrentDataIndex++;
}
lineInFile++;
super.progressBarStoredIncrement();
}
iLineInFile=lineInFile;
iLineInFile_CurrentDataIndex=lineInFile_CurrentDataIndex;
super.progressBarResetTitle();
super.progressBarIncrement(10);
return lineInFile - this.iStartParsingAtLine;
}

Fixed version (ground truth):
protected int loadDataParseFile(BufferedReader brFile,final int iNumberOfLinesInFile) throws IOException {
  allocateStorageBufferForTokenPattern();
  ListIterator<ParserTokenHandler> iterForAllocationInit=alTokenTargetToParserTokenType.listIterator();
  ParserTokenHandler bufferAllocationTokenInit;
  Vector<StorageType> vecBuffersTorage=new Vector<StorageType>();
  progressBarSetStoreInitTitle("String_Node_Str" + this.getFileName(),0,alTargetStorages.size());
  for (  IStorage tmpStorage : alTargetStorages) {
    boolean bStayInLoop=true;
    while ((iterForAllocationInit.hasNext()) && (bStayInLoop)) {
      bufferAllocationTokenInit=iterForAllocationInit.next();
switch (bufferAllocationTokenInit.getType()) {
case INT:
        tmpStorage.setSize(StorageType.INT,iNumberOfLinesInFile);
      vecBuffersTorage.addElement(StorageType.INT);
    bStayInLoop=false;
  break;
case FLOAT:
tmpStorage.setSize(StorageType.FLOAT,iNumberOfLinesInFile);
vecBuffersTorage.addElement(StorageType.FLOAT);
bStayInLoop=false;
break;
case STRING:
tmpStorage.setSize(StorageType.STRING,iNumberOfLinesInFile);
vecBuffersTorage.addElement(StorageType.STRING);
bStayInLoop=false;
break;
default :
}
}
}
Vector<String> vecBufferText=new Vector<String>(10);
StringBuffer strLineBuffer=new StringBuffer();
String sLine;
int lineInFile=0;
int lineInFile_CurrentDataIndex=0;
while (((sLine=brFile.readLine()) != null) && (lineInFile <= iStopParsingAtLine)) {
if (lineInFile >= this.iStartParsingAtLine) {
boolean bMaintainLoop=true;
StringTokenizer strTokenText=new StringTokenizer(sLine,"String_Node_Str");
strLineBuffer.setLength(0);
vecBufferText.clear();
int iCountTokens=strTokenText.countTokens();
if ((iCountTokens % 2) == 0) {
strTokenText=new StringTokenizer(sLine.replace("String_Node_Str","String_Node_Str"),"String_Node_Str");
}
if (iCountTokens > 1) {
strLineBuffer.append(strTokenText.nextToken());
boolean bToggle_Buffer=true;
while (strTokenText.hasMoreTokens()) {
String sBuffer=strTokenText.nextToken().trim();
if (bToggle_Buffer) {
vecBufferText.addElement(sBuffer);
strLineBuffer.append(sBuffer);
strLineBuffer.append("String_Node_Str");
bToggle_Buffer=false;
}
 else {
strLineBuffer.append(sBuffer);
bToggle_Buffer=true;
}
}
}
 else {
strLineBuffer.append(sLine);
}
StringTokenizer strToken=new StringTokenizer(new String(strLineBuffer));
ListIterator<ParserTokenHandler> iterPerLine=alTokenTargetToParserTokenType.listIterator();
int iDataArrayIndexPerLine=0;
ParserTokenHandler bufferIter=null;
while ((strToken.hasMoreTokens()) && (bMaintainLoop)) {
String sTokenObject=strToken.nextToken();
String[] bufferStringArray=null;
try {
bufferIter=iterPerLine.next();
switch (bufferIter.getType()) {
case ABORT:
bMaintainLoop=false;
break;
case INT:
int[] bufferIntArray=alTargetStorages.get(iDataArrayIndexPerLine).getArrayInt();
if (bufferIntArray == null) {
generalManager.getLogger().log(Level.SEVERE,"String_Node_Str");
break;
}
bufferIntArray[lineInFile_CurrentDataIndex]=new Integer(sTokenObject);
iDataArrayIndexPerLine++;
break;
case FLOAT:
float[] bufferFloatArray=alTargetStorages.get(iDataArrayIndexPerLine).getArrayFloat();
bufferFloatArray[lineInFile_CurrentDataIndex]=new Float(sTokenObject);
iDataArrayIndexPerLine++;
break;
case STRING:
bufferStringArray=alTargetStorages.get(iDataArrayIndexPerLine).getArrayString();
if (bufferStringArray == null) {
generalManager.getLogger().log(Level.SEVERE,"String_Node_Str");
break;
}
bufferStringArray[lineInFile_CurrentDataIndex]=sTokenObject;
iDataArrayIndexPerLine++;
break;
case SKIP:
break;
default :
generalManager.getLogger().log(Level.WARNING,"String_Node_Str");
}
}
 catch (NoSuchElementException nsee) {
bMaintainLoop=false;
}
catch (NumberFormatException nfe) {
if (bufferIter == null) {
}
 else {
}
}
catch (ArrayIndexOutOfBoundsException aie) {
String info="String_Node_Str" + lineInFile_CurrentDataIndex + "String_Node_Str";
if (bufferStringArray != null) {
info+=bufferStringArray.toString();
}
 else {
info+="String_Node_Str";
}
info+="String_Node_Str" + aie.toString();
System.out.println("String_Node_Str" + iDataArrayIndexPerLine + "String_Node_Str"+ aie.toString());
iDataArrayIndexPerLine++;
}
}
lineInFile_CurrentDataIndex++;
}
lineInFile++;
super.progressBarStoredIncrement();
}
iLineInFile=lineInFile;
iLineInFile_CurrentDataIndex=lineInFile_CurrentDataIndex;
super.progressBarResetTitle();
super.progressBarIncrement(10);
return lineInFile - this.iStartParsingAtLine;
}