Program: 54645
Project: 54645
Buggy source:
public void classToJava(ClassNode node,StringBuilder buffer,int indent){
  ClassNode outerNode=(ClassNode)DecompilerContext.getProperty(DecompilerContext.CURRENT_CLASS_NODE);
  DecompilerContext.setProperty(DecompilerContext.CURRENT_CLASS_NODE,node);
  int total_offset_lines=0;
  BytecodeMappingTracer dummy_tracer=new BytecodeMappingTracer();
  try {
    invokeProcessors(node);
    ClassWrapper wrapper=node.wrapper;
    StructClass cl=wrapper.getClassStruct();
    DecompilerContext.getLogger().startWriteClass(cl.qualifiedName);
    String lineSeparator=DecompilerContext.getNewLineSeparator();
    int start_class_def=buffer.length();
    writeClassDefinition(node,buffer,indent);
    total_offset_lines=buffer.substring(start_class_def).toString().split(lineSeparator,-1).length - 1;
    boolean hasContent=false;
    boolean enumFields=false;
    for (    StructField fd : cl.getFields()) {
      boolean hide=fd.isSynthetic() && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_SYNTHETIC) || wrapper.getHiddenMembers().contains(InterpreterUtil.makeUniqueKey(fd.getName(),fd.getDescriptor()));
      if (hide)       continue;
      boolean isEnum=fd.hasModifier(CodeConstants.ACC_ENUM) && DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_ENUM);
      if (isEnum) {
        if (enumFields) {
          buffer.append(',');
          buffer.append(lineSeparator);
        }
        enumFields=true;
      }
 else       if (enumFields) {
        buffer.append(';');
        buffer.append(lineSeparator);
        buffer.append(lineSeparator);
        enumFields=false;
      }
      fieldToJava(wrapper,cl,fd,buffer,indent + 1,dummy_tracer);
      hasContent=true;
    }
    if (enumFields) {
      buffer.append(';');
      buffer.append(lineSeparator);
    }
    for (    StructMethod mt : cl.getMethods()) {
      boolean hide=mt.isSynthetic() && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_SYNTHETIC) || mt.hasModifier(CodeConstants.ACC_BRIDGE) && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_BRIDGE) || wrapper.getHiddenMembers().contains(InterpreterUtil.makeUniqueKey(mt.getName(),mt.getDescriptor()));
      if (hide)       continue;
      int position=buffer.length();
      if (hasContent) {
        buffer.append(lineSeparator);
      }
      BytecodeMappingTracer method_tracer=new BytecodeMappingTracer(total_offset_lines);
      boolean methodSkipped=!methodToJava(node,mt,buffer,indent + 1,method_tracer);
      if (!methodSkipped) {
        hasContent=true;
        DecompilerContext.getBytecodeSourceMapper().addTracer(cl.qualifiedName,InterpreterUtil.makeUniqueKey(mt.getName(),mt.getDescriptor()),method_tracer);
        total_offset_lines=method_tracer.getCurrentSourceline();
      }
 else {
        buffer.setLength(position);
      }
    }
    for (    ClassNode inner : node.nested) {
      if (inner.type == ClassNode.CLASS_MEMBER) {
        StructClass innerCl=inner.classStruct;
        boolean isSynthetic=(inner.access & CodeConstants.ACC_SYNTHETIC) != 0 || innerCl.isSynthetic();
        boolean hide=isSynthetic && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_SYNTHETIC) || wrapper.getHiddenMembers().contains(innerCl.qualifiedName);
        if (hide)         continue;
        if (hasContent) {
          buffer.append(lineSeparator);
        }
        classToJava(inner,buffer,indent + 1);
        hasContent=true;
      }
    }
    InterpreterUtil.appendIndent(buffer,indent);
    buffer.append('}');
    if (node.type != ClassNode.CLASS_ANONYMOUS) {
      buffer.append(lineSeparator);
    }
  }
  finally {
    DecompilerContext.setProperty(DecompilerContext.CURRENT_CLASS_NODE,outerNode);
  }
  DecompilerContext.getLogger().endWriteClass();
}

Fixed version (ground truth):
public void classToJava(ClassNode node,StringBuilder buffer,int indent){
  ClassNode outerNode=(ClassNode)DecompilerContext.getProperty(DecompilerContext.CURRENT_CLASS_NODE);
  DecompilerContext.setProperty(DecompilerContext.CURRENT_CLASS_NODE,node);
  int total_offset_lines=0;
  BytecodeMappingTracer dummy_tracer=new BytecodeMappingTracer();
  try {
    invokeProcessors(node);
    ClassWrapper wrapper=node.wrapper;
    StructClass cl=wrapper.getClassStruct();
    DecompilerContext.getLogger().startWriteClass(cl.qualifiedName);
    String lineSeparator=DecompilerContext.getNewLineSeparator();
    int start_class_def=buffer.length();
    writeClassDefinition(node,buffer,indent);
    boolean hasContent=false;
    boolean enumFields=false;
    for (    StructField fd : cl.getFields()) {
      boolean hide=fd.isSynthetic() && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_SYNTHETIC) || wrapper.getHiddenMembers().contains(InterpreterUtil.makeUniqueKey(fd.getName(),fd.getDescriptor()));
      if (hide)       continue;
      boolean isEnum=fd.hasModifier(CodeConstants.ACC_ENUM) && DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_ENUM);
      if (isEnum) {
        if (enumFields) {
          buffer.append(',');
          buffer.append(lineSeparator);
        }
        enumFields=true;
      }
 else       if (enumFields) {
        buffer.append(';');
        buffer.append(lineSeparator);
        buffer.append(lineSeparator);
        enumFields=false;
      }
      fieldToJava(wrapper,cl,fd,buffer,indent + 1,dummy_tracer);
      hasContent=true;
    }
    if (enumFields) {
      buffer.append(';');
      buffer.append(lineSeparator);
    }
    total_offset_lines=buffer.substring(start_class_def).toString().split(lineSeparator,-1).length - 1;
    for (    StructMethod mt : cl.getMethods()) {
      boolean hide=mt.isSynthetic() && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_SYNTHETIC) || mt.hasModifier(CodeConstants.ACC_BRIDGE) && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_BRIDGE) || wrapper.getHiddenMembers().contains(InterpreterUtil.makeUniqueKey(mt.getName(),mt.getDescriptor()));
      if (hide)       continue;
      int position=buffer.length();
      if (hasContent) {
        buffer.append(lineSeparator);
      }
      BytecodeMappingTracer method_tracer=new BytecodeMappingTracer(total_offset_lines);
      boolean methodSkipped=!methodToJava(node,mt,buffer,indent + 1,method_tracer);
      if (!methodSkipped) {
        hasContent=true;
        DecompilerContext.getBytecodeSourceMapper().addTracer(cl.qualifiedName,InterpreterUtil.makeUniqueKey(mt.getName(),mt.getDescriptor()),method_tracer);
        total_offset_lines=(method_tracer.getCurrentSourceLine() + 1);
      }
 else {
        buffer.setLength(position);
      }
    }
    for (    ClassNode inner : node.nested) {
      if (inner.type == ClassNode.CLASS_MEMBER) {
        StructClass innerCl=inner.classStruct;
        boolean isSynthetic=(inner.access & CodeConstants.ACC_SYNTHETIC) != 0 || innerCl.isSynthetic();
        boolean hide=isSynthetic && DecompilerContext.getOption(IFernflowerPreferences.REMOVE_SYNTHETIC) || wrapper.getHiddenMembers().contains(innerCl.qualifiedName);
        if (hide)         continue;
        if (hasContent) {
          buffer.append(lineSeparator);
        }
        classToJava(inner,buffer,indent + 1);
        hasContent=true;
      }
    }
    InterpreterUtil.appendIndent(buffer,indent);
    buffer.append('}');
    if (node.type != ClassNode.CLASS_ANONYMOUS) {
      buffer.append(lineSeparator);
    }
  }
  finally {
    DecompilerContext.setProperty(DecompilerContext.CURRENT_CLASS_NODE,outerNode);
  }
  DecompilerContext.getLogger().endWriteClass();
}