Program: 136102
Project: 136102
Buggy source:
/** 
 * Parse the configuration file
 */
public final void parse(){
  Vect constants=(Vect)this.configTbl.get(Constant);
  Vect constraints=(Vect)this.configTbl.get(Constraint);
  Vect actionConstraints=(Vect)this.configTbl.get(ActionConstraint);
  Vect invariants=(Vect)this.configTbl.get(Invariant);
  Vect props=(Vect)this.configTbl.get(Prop);
  try {
    FileInputStream fis=FileUtil.newFIS(resolver.resolve(this.configFileName,false));
    if (fis == null) {
      throw new ConfigFileException(EC.CFG_ERROR_READING_FILE,new String[]{this.configFileName,"String_Node_Str"});
    }
    SimpleCharStream scs=new SimpleCharStream(fis,1,1);
    TLAplusParserTokenManager tmgr=new TLAplusParserTokenManager(scs,2);
    Token tt=getNextToken(tmgr);
    while (tt.kind != TLAplusParserConstants.EOF) {
      String tval=tt.image;
      int loc=scs.getBeginLine();
      if (tval.equals(Init)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{Init,String.valueOf(loc)});
        }
        String old=(String)this.configTbl.put(Init,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{Spec,String.valueOf(loc)});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Next)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{Next,String.valueOf(loc)});
        }
        String old=(String)this.configTbl.put(Next,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{Next,String.valueOf(loc)});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Spec)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{Spec,String.valueOf(loc)});
        }
        String old=(String)this.configTbl.put(Spec,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{Spec,String.valueOf(loc)});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(View)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{View,String.valueOf(loc)});
        }
        String old=(String)this.configTbl.put(View,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{View,String.valueOf(loc)});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Symmetry)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{Symmetry,String.valueOf(loc)});
        }
        String old=(String)this.configTbl.put(Symmetry,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{Symmetry,String.valueOf(loc)});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Type)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{Type,String.valueOf(loc)});
        }
        String old=(String)this.configTbl.put(Type,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{Type,String.valueOf(loc)});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(TypeConstraint)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{TypeConstraint,String.valueOf(loc)});
        }
        String old=(String)this.configTbl.put(TypeConstraint,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{TypeConstraint,String.valueOf(loc)});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Constant) || tval.equals(Constants)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          String lhs=tt.image;
          tt=getNextToken(tmgr);
          while (tt.image.equals("String_Node_Str")) {
            tt=getNextToken(tmgr);
            lhs=lhs + "String_Node_Str" + tt.image;
            tt=getNextToken(tmgr);
          }
          Vect line=new Vect();
          line.addElement(lhs);
          if (tt.image.equals("String_Node_Str")) {
            tt=getNextToken(tmgr);
            if (tt.image.equals("String_Node_Str")) {
              tt=getNextToken(tmgr);
              if (tt.kind == TLAplusParserConstants.EOF) {
                throw new ConfigFileException(EC.CFG_EXPECT_ID,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              String modName=tt.image;
              tt=getNextToken(tmgr);
              if (!tt.image.equals("String_Node_Str")) {
                throw new ConfigFileException(EC.CFG_EXPECTED_SYMBOL,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              tt=getNextToken(tmgr);
              if (tt.kind == TLAplusParserConstants.EOF) {
                throw new ConfigFileException(EC.CFG_EXPECT_ID,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              Hashtable defs=(Hashtable)this.modOverrides.get(modName);
              if (defs == null) {
                defs=new Hashtable();
                this.modOverrides.put(modName,defs);
              }
              defs.put(line.elementAt(0),tt.image);
            }
 else {
              if (tt.kind == TLAplusParserConstants.EOF) {
                throw new ConfigFileException(EC.CFG_EXPECT_ID,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              this.overrides.put(line.elementAt(0),tt.image);
            }
          }
 else {
            if (tt.image.equals("String_Node_Str")) {
              while (true) {
                tt=getNextToken(tmgr);
                Value arg=this.parseValue(tt,scs,tmgr);
                line.addElement(arg);
                tt=getNextToken(tmgr);
                if (!tt.image.equals("String_Node_Str"))                 break;
              }
              if (!tt.image.equals("String_Node_Str")) {
                throw new ConfigFileException(EC.CFG_GENERAL,new String[]{String.valueOf(loc)});
              }
              tt=getNextToken(tmgr);
            }
            if (!tt.image.equals("String_Node_Str")) {
              throw new ConfigFileException(EC.CFG_EXPECTED_SYMBOL,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
            }
            tt=getNextToken(tmgr);
            if (tt.image.equals("String_Node_Str")) {
              tt=getNextToken(tmgr);
              if (tt.kind == TLAplusParserConstants.EOF) {
                throw new ConfigFileException(EC.CFG_EXPECT_ID,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              String modName=tt.image;
              tt=getNextToken(tmgr);
              if (!tt.image.equals("String_Node_Str")) {
                throw new ConfigFileException(EC.CFG_EXPECTED_SYMBOL,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              tt=getNextToken(tmgr);
              line.addElement(this.parseValue(tt,scs,tmgr));
              Vect mConsts=(Vect)this.modConstants.get(modName);
              if (mConsts == null) {
                mConsts=new Vect();
                this.modConstants.put(modName,mConsts);
              }
              mConsts.addElement(line);
            }
 else {
              line.addElement(this.parseValue(tt,scs,tmgr));
              constants.addElement(line);
            }
          }
        }
      }
 else       if (tval.equals(Invariant) || tval.equals(Invariants)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          invariants.addElement(tt.image);
        }
      }
 else       if (tval.equals(Prop) || tval.equals(Props)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          props.addElement(tt.image);
        }
      }
 else       if (tval.equals(Constraint) || tval.equals(Constraints)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          constraints.addElement(tt.image);
        }
      }
 else       if (tval.equals(ActionConstraint) || tval.equals(ActionConstraints)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          actionConstraints.addElement(tt.image);
        }
      }
 else {
        throw new ConfigFileException(EC.CFG_EXPECTED_SYMBOL,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
      }
    }
  }
 catch (  IOException e) {
    throw new ConfigFileException(EC.CFG_ERROR_READING_FILE,new String[]{this.configFileName,e.getMessage()},e);
  }
}

Fixed version (ground truth):
/** 
 * Parse the configuration file
 */
public final void parse(){
  Vect constants=(Vect)this.configTbl.get(Constant);
  Vect constraints=(Vect)this.configTbl.get(Constraint);
  Vect actionConstraints=(Vect)this.configTbl.get(ActionConstraint);
  Vect invariants=(Vect)this.configTbl.get(Invariant);
  Vect props=(Vect)this.configTbl.get(Prop);
  try {
    FileInputStream fis=FileUtil.newFIS(resolver.resolve(this.configFileName,false));
    if (fis == null) {
      throw new ConfigFileException(EC.CFG_ERROR_READING_FILE,new String[]{this.configFileName,"String_Node_Str"});
    }
    SimpleCharStream scs=new SimpleCharStream(fis,1,1);
    TLAplusParserTokenManager tmgr=new TLAplusParserTokenManager(scs,2);
    Token tt=getNextToken(tmgr);
    while (tt.kind != TLAplusParserConstants.EOF) {
      String tval=tt.image;
      int loc=scs.getBeginLine();
      if (tval.equals(Init)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{String.valueOf(loc),Init});
        }
        String old=(String)this.configTbl.put(Init,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{String.valueOf(loc),Spec});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Next)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{String.valueOf(loc),Next});
        }
        String old=(String)this.configTbl.put(Next,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{String.valueOf(loc),Next});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Spec)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{String.valueOf(loc),Spec});
        }
        String old=(String)this.configTbl.put(Spec,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{String.valueOf(loc),Spec});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(View)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{String.valueOf(loc),View});
        }
        String old=(String)this.configTbl.put(View,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{String.valueOf(loc),View});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Symmetry)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{String.valueOf(loc),Symmetry});
        }
        String old=(String)this.configTbl.put(Symmetry,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{String.valueOf(loc),Symmetry});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Type)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{String.valueOf(loc),Type});
        }
        String old=(String)this.configTbl.put(Type,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{String.valueOf(loc),Type});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(TypeConstraint)) {
        tt=getNextToken(tmgr);
        if (tt.kind == TLAplusParserConstants.EOF) {
          throw new ConfigFileException(EC.CFG_MISSING_ID,new String[]{String.valueOf(loc),TypeConstraint});
        }
        String old=(String)this.configTbl.put(TypeConstraint,tt.image);
        if (old.length() != 0) {
          throw new ConfigFileException(EC.CFG_TWICE_KEYWORD,new String[]{String.valueOf(loc),TypeConstraint});
        }
        tt=getNextToken(tmgr);
      }
 else       if (tval.equals(Constant) || tval.equals(Constants)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          String lhs=tt.image;
          tt=getNextToken(tmgr);
          while (tt.image.equals("String_Node_Str")) {
            tt=getNextToken(tmgr);
            lhs=lhs + "String_Node_Str" + tt.image;
            tt=getNextToken(tmgr);
          }
          Vect line=new Vect();
          line.addElement(lhs);
          if (tt.image.equals("String_Node_Str")) {
            tt=getNextToken(tmgr);
            if (tt.image.equals("String_Node_Str")) {
              tt=getNextToken(tmgr);
              if (tt.kind == TLAplusParserConstants.EOF) {
                throw new ConfigFileException(EC.CFG_EXPECT_ID,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              String modName=tt.image;
              tt=getNextToken(tmgr);
              if (!tt.image.equals("String_Node_Str")) {
                throw new ConfigFileException(EC.CFG_EXPECTED_SYMBOL,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              tt=getNextToken(tmgr);
              if (tt.kind == TLAplusParserConstants.EOF) {
                throw new ConfigFileException(EC.CFG_EXPECT_ID,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              Hashtable defs=(Hashtable)this.modOverrides.get(modName);
              if (defs == null) {
                defs=new Hashtable();
                this.modOverrides.put(modName,defs);
              }
              defs.put(line.elementAt(0),tt.image);
            }
 else {
              if (tt.kind == TLAplusParserConstants.EOF) {
                throw new ConfigFileException(EC.CFG_EXPECT_ID,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              this.overrides.put(line.elementAt(0),tt.image);
            }
          }
 else {
            if (tt.image.equals("String_Node_Str")) {
              while (true) {
                tt=getNextToken(tmgr);
                Value arg=this.parseValue(tt,scs,tmgr);
                line.addElement(arg);
                tt=getNextToken(tmgr);
                if (!tt.image.equals("String_Node_Str"))                 break;
              }
              if (!tt.image.equals("String_Node_Str")) {
                throw new ConfigFileException(EC.CFG_GENERAL,new String[]{String.valueOf(loc)});
              }
              tt=getNextToken(tmgr);
            }
            if (!tt.image.equals("String_Node_Str")) {
              throw new ConfigFileException(EC.CFG_EXPECTED_SYMBOL,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
            }
            tt=getNextToken(tmgr);
            if (tt.image.equals("String_Node_Str")) {
              tt=getNextToken(tmgr);
              if (tt.kind == TLAplusParserConstants.EOF) {
                throw new ConfigFileException(EC.CFG_EXPECT_ID,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              String modName=tt.image;
              tt=getNextToken(tmgr);
              if (!tt.image.equals("String_Node_Str")) {
                throw new ConfigFileException(EC.CFG_EXPECTED_SYMBOL,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
              }
              tt=getNextToken(tmgr);
              line.addElement(this.parseValue(tt,scs,tmgr));
              Vect mConsts=(Vect)this.modConstants.get(modName);
              if (mConsts == null) {
                mConsts=new Vect();
                this.modConstants.put(modName,mConsts);
              }
              mConsts.addElement(line);
            }
 else {
              line.addElement(this.parseValue(tt,scs,tmgr));
              constants.addElement(line);
            }
          }
        }
      }
 else       if (tval.equals(Invariant) || tval.equals(Invariants)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          invariants.addElement(tt.image);
        }
      }
 else       if (tval.equals(Prop) || tval.equals(Props)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          props.addElement(tt.image);
        }
      }
 else       if (tval.equals(Constraint) || tval.equals(Constraints)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          constraints.addElement(tt.image);
        }
      }
 else       if (tval.equals(ActionConstraint) || tval.equals(ActionConstraints)) {
        while ((tt=getNextToken(tmgr)).kind != TLAplusParserConstants.EOF) {
          if (this.configTbl.get(tt.image) != null)           break;
          actionConstraints.addElement(tt.image);
        }
      }
 else {
        throw new ConfigFileException(EC.CFG_EXPECTED_SYMBOL,new String[]{String.valueOf(scs.getBeginLine()),"String_Node_Str"});
      }
    }
  }
 catch (  IOException e) {
    throw new ConfigFileException(EC.CFG_ERROR_READING_FILE,new String[]{this.configFileName,e.getMessage()},e);
  }
}