Program: 166841
Project: 166841
Buggy source:
/** 
 * Add visitors for class, method, field, and type declarations.
 */
private void addDeclarationWriters(){
  addWriter(CompilationUnit.class,new CompilationUnitWriter(this));
  addWriter(Javadoc.class,new JavadocCommentWriter(this));
  addWriter(TypeDeclaration.class,new TypeDeclarationWriter(this));
  addWriter(EnumDeclaration.class,new EnumDeclarationWriter(this));
  addWriter(MethodDeclaration.class,new MethodDeclarationWriter(this));
  addWriter(FieldDeclaration.class,new FieldDeclarationWriter(this));
  addWriter(SimpleType.class,new SimpleTypeWriter(this));
  addWriter(VariableDeclarationFragment.class,new CSharpASTNodeWriter<VariableDeclarationFragment>(this){
    @Override public void write(    VariableDeclarationFragment variableDeclarationFragment){
      if (variableDeclarationFragment.getExtraDimensions() > 0)       throw sourceNotSupported("String_Node_Str");
      writeNode(variableDeclarationFragment.getName());
      Expression initializer=variableDeclarationFragment.getInitializer();
      if (initializer != null) {
        copySpaceAndComments();
        matchAndWrite("String_Node_Str");
        copySpaceAndComments();
        writeNode(initializer);
      }
    }
  }
);
  addWriter(SingleVariableDeclaration.class,new CSharpASTNodeWriter<SingleVariableDeclaration>(this){
    @Override public void write(    SingleVariableDeclaration singleVariableDeclaration){
      if (singleVariableDeclaration.getExtraDimensions() > 0)       throw sourceNotSupported("String_Node_Str");
      List<?> modifiers=singleVariableDeclaration.modifiers();
      ensureModifiersJustFinalOrAnnotations(modifiers);
      skipModifiers(modifiers);
      Type type=singleVariableDeclaration.getType();
      if (singleVariableDeclaration.isVarargs()) {
        write("String_Node_Str");
        writeNode(type);
        copySpaceAndComments();
        matchAndWrite("String_Node_Str","String_Node_Str");
      }
 else       writeNode(type);
      copySpaceAndComments();
      writeNode(singleVariableDeclaration.getName());
      if (singleVariableDeclaration.getInitializer() != null)       throw new JUniversalException("String_Node_Str");
    }
  }
);
  addWriter(ParameterizedType.class,new CSharpASTNodeWriter<ParameterizedType>(this){
    @Override public void write(    ParameterizedType parameterizedType){
      writeNode(parameterizedType.getType());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      writeCommaDelimitedNodes(parameterizedType.typeArguments());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(WildcardType.class,new CSharpASTNodeWriter<WildcardType>(this){
    @Override public void write(    WildcardType wildcardType){
      ArrayList<WildcardType> wildcardTypes=getContext().getMethodWildcardTypes();
      if (wildcardTypes == null)       throw sourceNotSupported("String_Node_Str");
      writeWildcardTypeSyntheticName(wildcardTypes,wildcardType);
      setPositionToEndOfNode(wildcardType);
    }
  }
);
  addWriter(ArrayType.class,new CSharpASTNodeWriter<ArrayType>(this){
    @Override public void write(    ArrayType arrayType){
      writeNode(arrayType.getElementType());
      forEach(arrayType.dimensions(),(      Dimension dimension) -> {
        copySpaceAndComments();
        matchAndWrite("String_Node_Str");
        copySpaceAndComments();
        matchAndWrite("String_Node_Str");
      }
);
    }
  }
);
  addWriter(PrimitiveType.class,new CSharpASTNodeWriter<PrimitiveType>(this){
    @Override public void write(    PrimitiveType primitiveType){
      PrimitiveType.Code code=primitiveType.getPrimitiveTypeCode();
      if (code == PrimitiveType.BYTE)       matchAndWrite("String_Node_Str","String_Node_Str");
 else       if (code == PrimitiveType.SHORT)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.CHAR)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.INT)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.LONG)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.FLOAT)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.DOUBLE)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.BOOLEAN)       matchAndWrite("String_Node_Str","String_Node_Str");
 else       if (code == PrimitiveType.VOID)       matchAndWrite("String_Node_Str","String_Node_Str");
 else       throw invalidAST("String_Node_Str" + code);
    }
  }
);
  addWriter(ArrayInitializer.class,new CSharpASTNodeWriter<ArrayInitializer>(this){
    @Override public void write(    ArrayInitializer arrayInitializer){
      if (arrayInitializer.getParent() instanceof ArrayInitializer) {
        write("String_Node_Str");
      }
      matchAndWrite("String_Node_Str");
      writeCommaDelimitedNodes(arrayInitializer.expressions());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Add visitors for class, method, field, and type declarations.
 */
private void addDeclarationWriters(){
  addWriter(CompilationUnit.class,new CompilationUnitWriter(this));
  addWriter(Javadoc.class,new JavadocCommentWriter(this));
  addWriter(TypeDeclaration.class,new TypeDeclarationWriter(this));
  addWriter(EnumDeclaration.class,new EnumDeclarationWriter(this));
  addWriter(MethodDeclaration.class,new MethodDeclarationWriter(this));
  addWriter(FieldDeclaration.class,new FieldDeclarationWriter(this));
  addWriter(SimpleType.class,new SimpleTypeWriter(this));
  addWriter(VariableDeclarationFragment.class,new CSharpASTNodeWriter<VariableDeclarationFragment>(this){
    @Override public void write(    VariableDeclarationFragment variableDeclarationFragment){
      String name=variableDeclarationFragment.getName().getIdentifier();
      if (getContext().getTypeMethodNames().contains(name))       throw sourceNotSupported("String_Node_Str" + name + "String_Node_Str");
      if (variableDeclarationFragment.getExtraDimensions() > 0)       throw sourceNotSupported("String_Node_Str");
      writeNode(variableDeclarationFragment.getName());
      Expression initializer=variableDeclarationFragment.getInitializer();
      if (initializer != null) {
        copySpaceAndComments();
        matchAndWrite("String_Node_Str");
        copySpaceAndComments();
        writeNode(initializer);
      }
    }
  }
);
  addWriter(SingleVariableDeclaration.class,new CSharpASTNodeWriter<SingleVariableDeclaration>(this){
    @Override public void write(    SingleVariableDeclaration singleVariableDeclaration){
      if (singleVariableDeclaration.getExtraDimensions() > 0)       throw sourceNotSupported("String_Node_Str");
      List<?> modifiers=singleVariableDeclaration.modifiers();
      ensureModifiersJustFinalOrAnnotations(modifiers);
      skipModifiers(modifiers);
      Type type=singleVariableDeclaration.getType();
      if (singleVariableDeclaration.isVarargs()) {
        write("String_Node_Str");
        writeNode(type);
        copySpaceAndComments();
        matchAndWrite("String_Node_Str","String_Node_Str");
      }
 else       writeNode(type);
      copySpaceAndComments();
      writeNode(singleVariableDeclaration.getName());
      if (singleVariableDeclaration.getInitializer() != null)       throw new JUniversalException("String_Node_Str");
    }
  }
);
  addWriter(ParameterizedType.class,new CSharpASTNodeWriter<ParameterizedType>(this){
    @Override public void write(    ParameterizedType parameterizedType){
      writeNode(parameterizedType.getType());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
      writeCommaDelimitedNodes(parameterizedType.typeArguments());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
  addWriter(WildcardType.class,new CSharpASTNodeWriter<WildcardType>(this){
    @Override public void write(    WildcardType wildcardType){
      ArrayList<WildcardType> wildcardTypes=getContext().getMethodWildcardTypes();
      if (wildcardTypes == null)       throw sourceNotSupported("String_Node_Str");
      writeWildcardTypeSyntheticName(wildcardTypes,wildcardType);
      setPositionToEndOfNode(wildcardType);
    }
  }
);
  addWriter(ArrayType.class,new CSharpASTNodeWriter<ArrayType>(this){
    @Override public void write(    ArrayType arrayType){
      writeNode(arrayType.getElementType());
      forEach(arrayType.dimensions(),(      Dimension dimension) -> {
        copySpaceAndComments();
        matchAndWrite("String_Node_Str");
        copySpaceAndComments();
        matchAndWrite("String_Node_Str");
      }
);
    }
  }
);
  addWriter(PrimitiveType.class,new CSharpASTNodeWriter<PrimitiveType>(this){
    @Override public void write(    PrimitiveType primitiveType){
      PrimitiveType.Code code=primitiveType.getPrimitiveTypeCode();
      if (code == PrimitiveType.BYTE)       matchAndWrite("String_Node_Str","String_Node_Str");
 else       if (code == PrimitiveType.SHORT)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.CHAR)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.INT)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.LONG)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.FLOAT)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.DOUBLE)       matchAndWrite("String_Node_Str");
 else       if (code == PrimitiveType.BOOLEAN)       matchAndWrite("String_Node_Str","String_Node_Str");
 else       if (code == PrimitiveType.VOID)       matchAndWrite("String_Node_Str","String_Node_Str");
 else       throw invalidAST("String_Node_Str" + code);
    }
  }
);
  addWriter(ArrayInitializer.class,new CSharpASTNodeWriter<ArrayInitializer>(this){
    @Override public void write(    ArrayInitializer arrayInitializer){
      if (arrayInitializer.getParent() instanceof ArrayInitializer) {
        write("String_Node_Str");
      }
      matchAndWrite("String_Node_Str");
      writeCommaDelimitedNodes(arrayInitializer.expressions());
      copySpaceAndComments();
      matchAndWrite("String_Node_Str");
    }
  }
);
}