Program: 50090
Project: 50090
Buggy source:
/** 
 * Attempts to evaluate the given declaration (function, class, namespace, template, etc).
 */
void evalDeclaration(IASTDeclaration declaration) throws DOMException {
  if (declaration instanceof IASTFunctionDefinition && ((IASTFunctionDefinition)declaration).getDeclarator().getName().resolveBinding() instanceof IFunction) {
    MyLogger.log("String_Node_Str");
    ctx.funcMngr.evalFunction(declaration);
  }
 else   if (declaration instanceof IASTFunctionDefinition) {
    IBinding bind=((IASTFunctionDefinition)declaration).getDeclarator().getName().resolveBinding();
    if (bind instanceof IProblemBinding)     MyLogger.logImportant("String_Node_Str" + ((IProblemBinding)bind).getFileName() + ((IProblemBinding)bind).getLineNumber());
 else     MyLogger.logImportant("String_Node_Str" + bind.getClass().getCanonicalName());
  }
 else   if (declaration instanceof IASTSimpleDeclaration) {
    IASTSimpleDeclaration simple=(IASTSimpleDeclaration)declaration;
    evalDeclSpecifier(simple.getDeclSpecifier());
    List<MExpression> exprs=evaluateDeclarationReturnInitializers(simple);
    int i=0;
    for (    IASTDeclarator declarator : simple.getDeclarators()) {
      IBinding binding=declarator.getName().resolveBinding();
      if (declarator instanceof IASTFieldDeclarator && ((IASTFieldDeclarator)declarator).getBitFieldSize() != null) {
        MyLogger.log("String_Node_Str");
        ctx.bitfieldMngr.evalDeclBitfield((IField)binding,declarator);
      }
 else       if (binding instanceof IField) {
        MyLogger.log("String_Node_Str");
        generateField(binding,declarator,exprs.get(i));
      }
 else       if (binding instanceof IFunction && declarator instanceof IASTFunctionDeclarator) {
        CppFunction func=(CppFunction)ctx.typeMngr.getDeclFromType(evalBindingReturnType(binding));
        if (func == null) {
          func=new CppFunction();
          ctx.typeMngr.registerDecl(func,evalBindingReturnType(binding),declarator.getName(),NameType.CAMEL_CASE,declarator.getContainingFilename(),declarator.getFileLocation().getStartingLineNumber());
        }
        ctx.funcMngr.makeDefaultCalls((IASTFunctionDeclarator)declarator,binding);
      }
 else       if (binding instanceof IVariable) {
        generateVariable(binding,declarator,exprs.get(i));
      }
 else {
        MyLogger.logImportant("String_Node_Str" + declarator.getClass().getCanonicalName() + "String_Node_Str"+ binding.getClass().getName());
      }
      i++;
    }
  }
 else   if (declaration instanceof ICPPASTNamespaceDefinition) {
    ICPPASTNamespaceDefinition namespace=(ICPPASTNamespaceDefinition)declaration;
    MyLogger.log("String_Node_Str");
    for (    IASTDeclaration childDeclaration : namespace.getDeclarations())     evalDeclaration(childDeclaration);
  }
 else   if (declaration instanceof IASTASMDeclaration) {
    MyLogger.logImportant("String_Node_Str" + declaration.getRawSignature());
    MyLogger.exitOnError();
  }
 else   if (declaration instanceof IASTProblemDeclaration) {
    IASTProblemDeclaration p=(IASTProblemDeclaration)declaration;
    MyLogger.logImportant("String_Node_Str" + "String_Node_Str" + p.getRawSignature());
  }
 else   if (declaration instanceof ICPPASTVisibilityLabel) {
    MyLogger.log("String_Node_Str");
  }
 else   if (declaration instanceof ICPPASTUsingDirective) {
    MyLogger.log("String_Node_Str");
  }
 else   if (declaration instanceof ICPPASTNamespaceAlias) {
    MyLogger.log("String_Node_Str");
  }
 else   if (declaration instanceof ICPPASTUsingDeclaration) {
    MyLogger.log("String_Node_Str");
  }
 else   if (declaration instanceof ICPPASTLinkageSpecification) {
    ICPPASTLinkageSpecification linkageSpecification=(ICPPASTLinkageSpecification)declaration;
    MyLogger.log("String_Node_Str");
    for (    IASTDeclaration childDeclaration : linkageSpecification.getDeclarations())     evalDeclaration(childDeclaration);
  }
 else   if (declaration instanceof ICPPASTTemplateDeclaration) {
    ICPPASTTemplateDeclaration templateDeclaration=(ICPPASTTemplateDeclaration)declaration;
    evalDeclaration(templateDeclaration.getDeclaration());
  }
 else   if (declaration instanceof ICPPASTExplicitTemplateInstantiation) {
    ICPPASTExplicitTemplateInstantiation explicitTemplateInstantiation=(ICPPASTExplicitTemplateInstantiation)declaration;
    MyLogger.log("String_Node_Str");
    evalDeclaration(explicitTemplateInstantiation.getDeclaration());
  }
 else   if (declaration instanceof ICPPASTTemplateSpecialization) {
    ICPPASTTemplateSpecialization templateSpecialization=(ICPPASTTemplateSpecialization)declaration;
    MyLogger.log("String_Node_Str");
    evalDeclaration(templateSpecialization.getDeclaration());
  }
 else {
    MyLogger.log("String_Node_Str" + declaration.getClass().getCanonicalName());
    MyLogger.exitOnError();
  }
}

Fixed version (ground truth):
/** 
 * Attempts to evaluate the given declaration (function, class, namespace, template, etc).
 */
void evalDeclaration(IASTDeclaration declaration) throws DOMException {
  if (declaration instanceof IASTFunctionDefinition && ((IASTFunctionDefinition)declaration).getDeclarator().getName().resolveBinding() instanceof IFunction) {
    MyLogger.log("String_Node_Str");
    ctx.funcMngr.evalFunction(declaration);
  }
 else   if (declaration instanceof IASTFunctionDefinition) {
    IBinding bind=((IASTFunctionDefinition)declaration).getDeclarator().getName().resolveBinding();
    if (bind instanceof IProblemBinding)     MyLogger.logImportant("String_Node_Str" + ((IProblemBinding)bind).getFileName() + ((IProblemBinding)bind).getLineNumber());
 else     MyLogger.logImportant("String_Node_Str" + bind.getClass().getCanonicalName());
  }
 else   if (declaration instanceof IASTSimpleDeclaration) {
    IASTSimpleDeclaration simple=(IASTSimpleDeclaration)declaration;
    evalDeclSpecifier(simple.getDeclSpecifier());
    List<MExpression> exprs=evaluateDeclarationReturnInitializers(simple,InitType.WRAPPED);
    int i=0;
    for (    IASTDeclarator declarator : simple.getDeclarators()) {
      IBinding binding=declarator.getName().resolveBinding();
      if (declarator instanceof IASTFieldDeclarator && ((IASTFieldDeclarator)declarator).getBitFieldSize() != null) {
        MyLogger.log("String_Node_Str");
        ctx.bitfieldMngr.evalDeclBitfield((IField)binding,declarator);
      }
 else       if (binding instanceof IField) {
        MyLogger.log("String_Node_Str");
        generateField(binding,declarator,exprs.get(i));
      }
 else       if (binding instanceof IFunction && declarator instanceof IASTFunctionDeclarator) {
        CppFunction func=(CppFunction)ctx.typeMngr.getDeclFromType(evalBindingReturnType(binding));
        if (func == null) {
          func=new CppFunction();
          ctx.typeMngr.registerDecl(func,evalBindingReturnType(binding),declarator.getName(),NameType.CAMEL_CASE,declarator.getContainingFilename(),declarator.getFileLocation().getStartingLineNumber());
        }
        ctx.funcMngr.makeDefaultCalls((IASTFunctionDeclarator)declarator,binding);
      }
 else       if (binding instanceof IVariable) {
        generateVariable(binding,declarator,exprs.get(i));
      }
 else {
        MyLogger.logImportant("String_Node_Str" + declarator.getClass().getCanonicalName() + "String_Node_Str"+ binding.getClass().getName());
      }
      i++;
    }
  }
 else   if (declaration instanceof ICPPASTNamespaceDefinition) {
    ICPPASTNamespaceDefinition namespace=(ICPPASTNamespaceDefinition)declaration;
    MyLogger.log("String_Node_Str");
    for (    IASTDeclaration childDeclaration : namespace.getDeclarations())     evalDeclaration(childDeclaration);
  }
 else   if (declaration instanceof IASTASMDeclaration) {
    MyLogger.logImportant("String_Node_Str" + declaration.getRawSignature());
    MyLogger.exitOnError();
  }
 else   if (declaration instanceof IASTProblemDeclaration) {
    IASTProblemDeclaration p=(IASTProblemDeclaration)declaration;
    MyLogger.logImportant("String_Node_Str" + "String_Node_Str" + p.getRawSignature());
  }
 else   if (declaration instanceof ICPPASTVisibilityLabel) {
    MyLogger.log("String_Node_Str");
  }
 else   if (declaration instanceof ICPPASTUsingDirective) {
    MyLogger.log("String_Node_Str");
  }
 else   if (declaration instanceof ICPPASTNamespaceAlias) {
    MyLogger.log("String_Node_Str");
  }
 else   if (declaration instanceof ICPPASTUsingDeclaration) {
    MyLogger.log("String_Node_Str");
  }
 else   if (declaration instanceof ICPPASTLinkageSpecification) {
    ICPPASTLinkageSpecification linkageSpecification=(ICPPASTLinkageSpecification)declaration;
    MyLogger.log("String_Node_Str");
    for (    IASTDeclaration childDeclaration : linkageSpecification.getDeclarations())     evalDeclaration(childDeclaration);
  }
 else   if (declaration instanceof ICPPASTTemplateDeclaration) {
    ICPPASTTemplateDeclaration templateDeclaration=(ICPPASTTemplateDeclaration)declaration;
    evalDeclaration(templateDeclaration.getDeclaration());
  }
 else   if (declaration instanceof ICPPASTExplicitTemplateInstantiation) {
    ICPPASTExplicitTemplateInstantiation explicitTemplateInstantiation=(ICPPASTExplicitTemplateInstantiation)declaration;
    MyLogger.log("String_Node_Str");
    evalDeclaration(explicitTemplateInstantiation.getDeclaration());
  }
 else   if (declaration instanceof ICPPASTTemplateSpecialization) {
    ICPPASTTemplateSpecialization templateSpecialization=(ICPPASTTemplateSpecialization)declaration;
    MyLogger.log("String_Node_Str");
    evalDeclaration(templateSpecialization.getDeclaration());
  }
 else {
    MyLogger.log("String_Node_Str" + declaration.getClass().getCanonicalName());
    MyLogger.exitOnError();
  }
}