Program: 54644
Project: 54644
Buggy source:
private boolean methodToJava(ClassNode node,StructMethod mt,StringBuilder buffer,int indent,BytecodeMappingTracer tracer){
  ClassWrapper wrapper=node.wrapper;
  StructClass cl=wrapper.getClassStruct();
  MethodWrapper methodWrapper=wrapper.getMethodWrapper(mt.getName(),mt.getDescriptor());
  boolean hideMethod=false;
  int start_index_method=buffer.length();
  String indentString=InterpreterUtil.getIndentString(indent);
  String lineSeparator=DecompilerContext.getNewLineSeparator();
  MethodWrapper outerWrapper=(MethodWrapper)DecompilerContext.getProperty(DecompilerContext.CURRENT_METHOD_WRAPPER);
  DecompilerContext.setProperty(DecompilerContext.CURRENT_METHOD_WRAPPER,methodWrapper);
  try {
    boolean isInterface=cl.hasModifier(CodeConstants.ACC_INTERFACE);
    boolean isAnnotation=cl.hasModifier(CodeConstants.ACC_ANNOTATION);
    boolean isEnum=cl.hasModifier(CodeConstants.ACC_ENUM) && DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_ENUM);
    boolean isDeprecated=mt.getAttributes().containsKey("String_Node_Str");
    boolean clinit=false, init=false, dinit=false;
    MethodDescriptor md=MethodDescriptor.parseDescriptor(mt.getDescriptor());
    int flags=mt.getAccessFlags();
    if ((flags & CodeConstants.ACC_NATIVE) != 0) {
      flags&=~CodeConstants.ACC_STRICT;
    }
    if ("String_Node_Str".equals(mt.getName())) {
      flags&=CodeConstants.ACC_STATIC;
    }
    if (isDeprecated) {
      appendDeprecation(buffer,indentString,lineSeparator);
    }
    if (interceptor != null) {
      String oldName=interceptor.getOldName(cl.qualifiedName + "String_Node_Str" + mt.getName()+ "String_Node_Str"+ mt.getDescriptor());
      appendRenameComment(buffer,oldName,MType.METHOD,indent,lineSeparator);
    }
    boolean isSynthetic=(flags & CodeConstants.ACC_SYNTHETIC) != 0 || mt.getAttributes().containsKey("String_Node_Str");
    boolean isBridge=(flags & CodeConstants.ACC_BRIDGE) != 0;
    if (isSynthetic) {
      appendComment(buffer,"String_Node_Str",indentString,lineSeparator);
    }
    if (isBridge) {
      appendComment(buffer,"String_Node_Str",indentString,lineSeparator);
    }
    appendAnnotations(buffer,mt,indent,lineSeparator);
    buffer.append(indentString);
    appendModifiers(buffer,flags,METHOD_ALLOWED,isInterface,METHOD_EXCLUDED);
    if (isInterface && mt.containsCode()) {
      buffer.append("String_Node_Str");
    }
    String name=mt.getName();
    if ("String_Node_Str".equals(name)) {
      if (node.type == ClassNode.CLASS_ANONYMOUS) {
        name="String_Node_Str";
        dinit=true;
      }
 else {
        name=node.simpleName;
        init=true;
      }
    }
 else     if ("String_Node_Str".equals(name)) {
      name="String_Node_Str";
      clinit=true;
    }
    GenericMethodDescriptor descriptor=null;
    if (DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_GENERIC_SIGNATURES)) {
      StructGenericSignatureAttribute attr=(StructGenericSignatureAttribute)mt.getAttributes().getWithKey("String_Node_Str");
      if (attr != null) {
        descriptor=GenericMain.parseMethodSignature(attr.getSignature());
        if (descriptor != null) {
          int actualParams=md.params.length;
          if (isEnum && init)           actualParams-=2;
          if (actualParams != descriptor.params.size()) {
            String message="String_Node_Str" + mt.getName() + "String_Node_Str"+ mt.getDescriptor();
            DecompilerContext.getLogger().writeMessage(message,IFernflowerLogger.Severity.WARN);
            descriptor=null;
          }
        }
      }
    }
    boolean throwsExceptions=false;
    int paramCount=0;
    if (!clinit && !dinit) {
      boolean thisVar=!mt.hasModifier(CodeConstants.ACC_STATIC);
      if (descriptor != null && !descriptor.fparameters.isEmpty()) {
        appendTypeParameters(buffer,descriptor.fparameters,descriptor.fbounds);
        buffer.append(' ');
      }
      if (!init) {
        if (descriptor != null) {
          buffer.append(GenericMain.getGenericCastTypeName(descriptor.ret));
        }
 else {
          buffer.append(ExprProcessor.getCastTypeName(md.ret));
        }
        buffer.append(' ');
      }
      buffer.append(name);
      buffer.append('(');
      List<VarVersionPaar> signFields=methodWrapper.signatureFields;
      int lastVisibleParameterIndex=-1;
      for (int i=0; i < md.params.length; i++) {
        if (signFields == null || signFields.get(i) == null) {
          lastVisibleParameterIndex=i;
        }
      }
      boolean firstParameter=true;
      int index=isEnum && init ? 3 : thisVar ? 1 : 0;
      int start=isEnum && init && descriptor == null ? 2 : 0;
      int params=descriptor == null ? md.params.length : descriptor.params.size();
      for (int i=start; i < params; i++) {
        if (signFields == null || signFields.get(i) == null) {
          if (!firstParameter) {
            buffer.append("String_Node_Str");
          }
          appendParameterAnnotations(buffer,mt,paramCount);
          if (methodWrapper.varproc.getVarFinal(new VarVersionPaar(index,0)) == VarTypeProcessor.VAR_FINALEXPLICIT) {
            buffer.append("String_Node_Str");
          }
          if (descriptor != null) {
            GenericType parameterType=descriptor.params.get(i);
            boolean isVarArg=(i == lastVisibleParameterIndex && mt.hasModifier(CodeConstants.ACC_VARARGS) && parameterType.arraydim > 0);
            if (isVarArg) {
              parameterType.arraydim--;
            }
            String typeName=GenericMain.getGenericCastTypeName(parameterType);
            if (ExprProcessor.UNDEFINED_TYPE_STRING.equals(typeName) && DecompilerContext.getOption(IFernflowerPreferences.UNDEFINED_PARAM_TYPE_OBJECT)) {
              typeName=ExprProcessor.getCastTypeName(VarType.VARTYPE_OBJECT);
            }
            buffer.append(typeName);
            if (isVarArg) {
              buffer.append("String_Node_Str");
            }
          }
 else {
            VarType parameterType=md.params[i].copy();
            boolean isVarArg=(i == lastVisibleParameterIndex && mt.hasModifier(CodeConstants.ACC_VARARGS) && parameterType.arraydim > 0);
            if (isVarArg) {
              parameterType.decArrayDim();
            }
            String typeName=ExprProcessor.getCastTypeName(parameterType);
            if (ExprProcessor.UNDEFINED_TYPE_STRING.equals(typeName) && DecompilerContext.getOption(IFernflowerPreferences.UNDEFINED_PARAM_TYPE_OBJECT)) {
              typeName=ExprProcessor.getCastTypeName(VarType.VARTYPE_OBJECT);
            }
            buffer.append(typeName);
            if (isVarArg) {
              buffer.append("String_Node_Str");
            }
          }
          buffer.append(' ');
          String parameterName=methodWrapper.varproc.getVarName(new VarVersionPaar(index,0));
          buffer.append(parameterName == null ? "String_Node_Str" + index : parameterName);
          firstParameter=false;
          paramCount++;
        }
        index+=md.params[i].stack_size;
      }
      buffer.append(')');
      StructExceptionsAttribute attr=(StructExceptionsAttribute)mt.getAttributes().getWithKey("String_Node_Str");
      if ((descriptor != null && !descriptor.exceptions.isEmpty()) || attr != null) {
        throwsExceptions=true;
        buffer.append("String_Node_Str");
        for (int i=0; i < attr.getThrowsExceptions().size(); i++) {
          if (i > 0) {
            buffer.append("String_Node_Str");
          }
          if (descriptor != null && !descriptor.exceptions.isEmpty()) {
            GenericType type=descriptor.exceptions.get(i);
            buffer.append(GenericMain.getGenericCastTypeName(type));
          }
 else {
            VarType type=new VarType(attr.getExcClassname(i,cl.getPool()),true);
            buffer.append(ExprProcessor.getCastTypeName(type));
          }
        }
      }
    }
    if ((flags & (CodeConstants.ACC_ABSTRACT | CodeConstants.ACC_NATIVE)) != 0) {
      if (isAnnotation) {
        StructAnnDefaultAttribute attr=(StructAnnDefaultAttribute)mt.getAttributes().getWithKey("String_Node_Str");
        if (attr != null) {
          buffer.append("String_Node_Str");
          buffer.append(attr.getDefaultValue().toJava(indent + 1,new BytecodeMappingTracer()));
        }
      }
      buffer.append(';');
      buffer.append(lineSeparator);
    }
 else {
      if (!clinit && !dinit) {
        buffer.append(' ');
      }
      buffer.append('{');
      buffer.append(lineSeparator);
      RootStatement root=wrapper.getMethodWrapper(mt.getName(),mt.getDescriptor()).root;
      if (root != null && !methodWrapper.decompiledWithErrors) {
        try {
          tracer.setCurrentSourceline(buffer.substring(start_index_method).split(lineSeparator,-1).length - 1);
          String code=root.toJava(indent + 1,tracer);
          hideMethod=(clinit || dinit || hideConstructor(wrapper,init,throwsExceptions,paramCount)) && code.length() == 0;
          buffer.append(code);
        }
 catch (        Throwable ex) {
          DecompilerContext.getLogger().writeMessage("String_Node_Str" + mt.getName() + "String_Node_Str"+ mt.getDescriptor()+ "String_Node_Str",ex);
          methodWrapper.decompiledWithErrors=true;
        }
      }
      if (methodWrapper.decompiledWithErrors) {
        buffer.append(InterpreterUtil.getIndentString(indent + 1));
        buffer.append("String_Node_Str");
        buffer.append(lineSeparator);
      }
      buffer.append(indentString);
      buffer.append('}');
      buffer.append(lineSeparator);
    }
  }
  finally {
    DecompilerContext.setProperty(DecompilerContext.CURRENT_METHOD_WRAPPER,outerWrapper);
  }
  tracer.setCurrentSourceline(buffer.substring(start_index_method).split(lineSeparator,-1).length - 1);
  return !hideMethod;
}

Fixed version (ground truth):
private boolean methodToJava(ClassNode node,StructMethod mt,StringBuilder buffer,int indent,BytecodeMappingTracer tracer){
  ClassWrapper wrapper=node.wrapper;
  StructClass cl=wrapper.getClassStruct();
  MethodWrapper methodWrapper=wrapper.getMethodWrapper(mt.getName(),mt.getDescriptor());
  boolean hideMethod=false;
  int start_index_method=buffer.length();
  String indentString=InterpreterUtil.getIndentString(indent);
  String lineSeparator=DecompilerContext.getNewLineSeparator();
  MethodWrapper outerWrapper=(MethodWrapper)DecompilerContext.getProperty(DecompilerContext.CURRENT_METHOD_WRAPPER);
  DecompilerContext.setProperty(DecompilerContext.CURRENT_METHOD_WRAPPER,methodWrapper);
  try {
    boolean isInterface=cl.hasModifier(CodeConstants.ACC_INTERFACE);
    boolean isAnnotation=cl.hasModifier(CodeConstants.ACC_ANNOTATION);
    boolean isEnum=cl.hasModifier(CodeConstants.ACC_ENUM) && DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_ENUM);
    boolean isDeprecated=mt.getAttributes().containsKey("String_Node_Str");
    boolean clinit=false, init=false, dinit=false;
    MethodDescriptor md=MethodDescriptor.parseDescriptor(mt.getDescriptor());
    int flags=mt.getAccessFlags();
    if ((flags & CodeConstants.ACC_NATIVE) != 0) {
      flags&=~CodeConstants.ACC_STRICT;
    }
    if ("String_Node_Str".equals(mt.getName())) {
      flags&=CodeConstants.ACC_STATIC;
    }
    if (isDeprecated) {
      appendDeprecation(buffer,indentString,lineSeparator);
    }
    if (interceptor != null) {
      String oldName=interceptor.getOldName(cl.qualifiedName + "String_Node_Str" + mt.getName()+ "String_Node_Str"+ mt.getDescriptor());
      appendRenameComment(buffer,oldName,MType.METHOD,indent,lineSeparator);
    }
    boolean isSynthetic=(flags & CodeConstants.ACC_SYNTHETIC) != 0 || mt.getAttributes().containsKey("String_Node_Str");
    boolean isBridge=(flags & CodeConstants.ACC_BRIDGE) != 0;
    if (isSynthetic) {
      appendComment(buffer,"String_Node_Str",indentString,lineSeparator);
    }
    if (isBridge) {
      appendComment(buffer,"String_Node_Str",indentString,lineSeparator);
    }
    appendAnnotations(buffer,mt,indent,lineSeparator);
    buffer.append(indentString);
    appendModifiers(buffer,flags,METHOD_ALLOWED,isInterface,METHOD_EXCLUDED);
    if (isInterface && mt.containsCode()) {
      buffer.append("String_Node_Str");
    }
    String name=mt.getName();
    if ("String_Node_Str".equals(name)) {
      if (node.type == ClassNode.CLASS_ANONYMOUS) {
        name="String_Node_Str";
        dinit=true;
      }
 else {
        name=node.simpleName;
        init=true;
      }
    }
 else     if ("String_Node_Str".equals(name)) {
      name="String_Node_Str";
      clinit=true;
    }
    GenericMethodDescriptor descriptor=null;
    if (DecompilerContext.getOption(IFernflowerPreferences.DECOMPILE_GENERIC_SIGNATURES)) {
      StructGenericSignatureAttribute attr=(StructGenericSignatureAttribute)mt.getAttributes().getWithKey("String_Node_Str");
      if (attr != null) {
        descriptor=GenericMain.parseMethodSignature(attr.getSignature());
        if (descriptor != null) {
          int actualParams=md.params.length;
          if (isEnum && init)           actualParams-=2;
          if (actualParams != descriptor.params.size()) {
            String message="String_Node_Str" + mt.getName() + "String_Node_Str"+ mt.getDescriptor();
            DecompilerContext.getLogger().writeMessage(message,IFernflowerLogger.Severity.WARN);
            descriptor=null;
          }
        }
      }
    }
    boolean throwsExceptions=false;
    int paramCount=0;
    if (!clinit && !dinit) {
      boolean thisVar=!mt.hasModifier(CodeConstants.ACC_STATIC);
      if (descriptor != null && !descriptor.fparameters.isEmpty()) {
        appendTypeParameters(buffer,descriptor.fparameters,descriptor.fbounds);
        buffer.append(' ');
      }
      if (!init) {
        if (descriptor != null) {
          buffer.append(GenericMain.getGenericCastTypeName(descriptor.ret));
        }
 else {
          buffer.append(ExprProcessor.getCastTypeName(md.ret));
        }
        buffer.append(' ');
      }
      buffer.append(name);
      buffer.append('(');
      List<VarVersionPaar> signFields=methodWrapper.signatureFields;
      int lastVisibleParameterIndex=-1;
      for (int i=0; i < md.params.length; i++) {
        if (signFields == null || signFields.get(i) == null) {
          lastVisibleParameterIndex=i;
        }
      }
      boolean firstParameter=true;
      int index=isEnum && init ? 3 : thisVar ? 1 : 0;
      int start=isEnum && init && descriptor == null ? 2 : 0;
      int params=descriptor == null ? md.params.length : descriptor.params.size();
      for (int i=start; i < params; i++) {
        if (signFields == null || signFields.get(i) == null) {
          if (!firstParameter) {
            buffer.append("String_Node_Str");
          }
          appendParameterAnnotations(buffer,mt,paramCount);
          if (methodWrapper.varproc.getVarFinal(new VarVersionPaar(index,0)) == VarTypeProcessor.VAR_FINALEXPLICIT) {
            buffer.append("String_Node_Str");
          }
          if (descriptor != null) {
            GenericType parameterType=descriptor.params.get(i);
            boolean isVarArg=(i == lastVisibleParameterIndex && mt.hasModifier(CodeConstants.ACC_VARARGS) && parameterType.arraydim > 0);
            if (isVarArg) {
              parameterType.arraydim--;
            }
            String typeName=GenericMain.getGenericCastTypeName(parameterType);
            if (ExprProcessor.UNDEFINED_TYPE_STRING.equals(typeName) && DecompilerContext.getOption(IFernflowerPreferences.UNDEFINED_PARAM_TYPE_OBJECT)) {
              typeName=ExprProcessor.getCastTypeName(VarType.VARTYPE_OBJECT);
            }
            buffer.append(typeName);
            if (isVarArg) {
              buffer.append("String_Node_Str");
            }
          }
 else {
            VarType parameterType=md.params[i].copy();
            boolean isVarArg=(i == lastVisibleParameterIndex && mt.hasModifier(CodeConstants.ACC_VARARGS) && parameterType.arraydim > 0);
            if (isVarArg) {
              parameterType.decArrayDim();
            }
            String typeName=ExprProcessor.getCastTypeName(parameterType);
            if (ExprProcessor.UNDEFINED_TYPE_STRING.equals(typeName) && DecompilerContext.getOption(IFernflowerPreferences.UNDEFINED_PARAM_TYPE_OBJECT)) {
              typeName=ExprProcessor.getCastTypeName(VarType.VARTYPE_OBJECT);
            }
            buffer.append(typeName);
            if (isVarArg) {
              buffer.append("String_Node_Str");
            }
          }
          buffer.append(' ');
          String parameterName=methodWrapper.varproc.getVarName(new VarVersionPaar(index,0));
          buffer.append(parameterName == null ? "String_Node_Str" + index : parameterName);
          firstParameter=false;
          paramCount++;
        }
        index+=md.params[i].stack_size;
      }
      buffer.append(')');
      StructExceptionsAttribute attr=(StructExceptionsAttribute)mt.getAttributes().getWithKey("String_Node_Str");
      if ((descriptor != null && !descriptor.exceptions.isEmpty()) || attr != null) {
        throwsExceptions=true;
        buffer.append("String_Node_Str");
        for (int i=0; i < attr.getThrowsExceptions().size(); i++) {
          if (i > 0) {
            buffer.append("String_Node_Str");
          }
          if (descriptor != null && !descriptor.exceptions.isEmpty()) {
            GenericType type=descriptor.exceptions.get(i);
            buffer.append(GenericMain.getGenericCastTypeName(type));
          }
 else {
            VarType type=new VarType(attr.getExcClassname(i,cl.getPool()),true);
            buffer.append(ExprProcessor.getCastTypeName(type));
          }
        }
      }
    }
    if ((flags & (CodeConstants.ACC_ABSTRACT | CodeConstants.ACC_NATIVE)) != 0) {
      if (isAnnotation) {
        StructAnnDefaultAttribute attr=(StructAnnDefaultAttribute)mt.getAttributes().getWithKey("String_Node_Str");
        if (attr != null) {
          buffer.append("String_Node_Str");
          buffer.append(attr.getDefaultValue().toJava(indent + 1,new BytecodeMappingTracer()));
        }
      }
      buffer.append(';');
      buffer.append(lineSeparator);
    }
 else {
      if (!clinit && !dinit) {
        buffer.append(' ');
      }
      buffer.append('{');
      buffer.append(lineSeparator);
      RootStatement root=wrapper.getMethodWrapper(mt.getName(),mt.getDescriptor()).root;
      if (root != null && !methodWrapper.decompiledWithErrors) {
        try {
          tracer.incrementCurrentSourceLine(buffer.substring(start_index_method).split(lineSeparator,-1).length - 1);
          String code=root.toJava(indent + 1,tracer);
          hideMethod=(clinit || dinit || hideConstructor(wrapper,init,throwsExceptions,paramCount)) && code.length() == 0;
          buffer.append(code);
        }
 catch (        Throwable ex) {
          DecompilerContext.getLogger().writeMessage("String_Node_Str" + mt.getName() + "String_Node_Str"+ mt.getDescriptor()+ "String_Node_Str",ex);
          methodWrapper.decompiledWithErrors=true;
        }
      }
      if (methodWrapper.decompiledWithErrors) {
        buffer.append(InterpreterUtil.getIndentString(indent + 1));
        buffer.append("String_Node_Str");
        buffer.append(lineSeparator);
      }
      buffer.append(indentString);
      buffer.append('}');
      buffer.append(lineSeparator);
    }
  }
  finally {
    DecompilerContext.setProperty(DecompilerContext.CURRENT_METHOD_WRAPPER,outerWrapper);
  }
  tracer.setCurrentSourceLine(buffer.substring(start_index_method).split(lineSeparator,-1).length - 1);
  return !hideMethod;
}