Program: 17091
Project: 17091
Buggy source:
public JsrGenerator writeJsr(final IJstType type,boolean enableScriptingJava){
  if (type == null) {
    throw new NullPointerException("String_Node_Str");
  }
  m_enableScriptingJava=enableScriptingJava;
  for (  IJsrGenListener listener : m_listeners) {
    listener.initialize(type);
  }
  setUp(type);
  if (type.isOType()) {
    return writeOTypeJsr(type);
  }
  for (int i=0; i < m_initialIndent; i++) {
    indent();
  }
  if (m_clzType.isEmbededType()) {
    writeIndent();
    setupDefaultExtend(true);
  }
 else {
    writePkg();
    writeNewline();
    writeImports();
    writeNewline();
    writeCodeGenMarker(JsrGenerator.class);
    writeNewline();
  }
  String jsrName=type.getSimpleName() + JSR_SUFFIX;
  writeJsrClassDefinition(jsrName);
  getWriter().append("String_Node_Str");
  indent();
  boolean writeStatic=false;
  if (type.isInterface() || type.isMixin()) {
    if (!m_clzType.isEmbededType()) {
      writeJsrStaticDeclaration(jsrName);
      writeJsrResourceSpec(type);
    }
  }
 else {
    writeNewlineAndIndent();
    getWriter().append(SERIAL_ID);
    writeNewline();
    writeStatic=m_clzType.getModifiers().isStatic() || !m_clzType.isEmbededType();
    if (writeStatic) {
      writeJsrStaticDeclaration(jsrName);
    }
    if (!m_clzType.isEmbededType()) {
      writeJsrResourceSpec(type);
    }
    if (!m_skip_methods) {
      writeConstructors(jsrName);
    }
    writeJsObjProtectedConstructor(jsrName);
    for (    IJsrGenListener listener : m_listeners) {
      listener.postConstructors(getWriter(),getStyle());
    }
  }
  if (!type.isMixin() && !m_skip_methods) {
    writeProps();
    writeProtos();
  }
  List<? extends IJstType> embededTypes=m_clzType.getEmbededTypes();
  if (!m_clzType.isMixin() && embededTypes.size() > 0) {
    writeNewline();
    for (    IJstType embededType : embededTypes) {
      if (!isSameGroup(m_clzType,embededType)) {
        continue;
      }
      if (!embededType.isMixin() && !embededType.getModifiers().isPrivate()) {
        writeNewline();
        JsrGenerator sibJsr=new JsrGenerator(getWriter(),getStyle(),m_config.getFilters());
        sibJsr.setInitialIndent(m_initialIndent + 1);
        sibJsr.writeJsr(embededType,this);
      }
    }
  }
  if (!m_skip_methods && needPrototype(m_clzType)) {
    writeTypeRef();
  }
  outdent();
  writeNewline();
  if (m_clzType.isEmbededType()) {
    writeIndent();
  }
  getWriter().append("String_Node_Str");
  return this;
}

Fixed version (ground truth):
public JsrGenerator writeJsr(final IJstType type,boolean enableScriptingJava){
  if (type == null) {
    throw new NullPointerException("String_Node_Str");
  }
  m_enableScriptingJava=enableScriptingJava;
  for (  IJsrGenListener listener : m_listeners) {
    listener.initialize(type);
  }
  setUp(type);
  if (type.isOType()) {
    return writeOTypeJsr(type);
  }
  for (int i=0; i < m_initialIndent; i++) {
    indent();
  }
  if (m_clzType.isEmbededType()) {
    writeIndent();
    setupDefaultExtend(true);
  }
 else {
    writePkg();
    writeNewline();
    writeImports();
    writeNewline();
    writeCodeGenMarker(JsrGenerator.class);
    writeNewline();
  }
  String jsrName=type.getSimpleName() + JSR_SUFFIX;
  writeJsrClassDefinition(jsrName);
  getWriter().append("String_Node_Str");
  indent();
  boolean writeStatic=false;
  if (type.isInterface() || type.isMixin()) {
    if (!m_clzType.isEmbededType()) {
      writeJsrStaticDeclaration(jsrName);
      writeJsrResourceSpec(type);
    }
  }
 else {
    writeNewlineAndIndent();
    getWriter().append(SERIAL_ID);
    writeNewline();
    writeStatic=m_clzType.getModifiers().isStatic() || !m_clzType.isEmbededType();
    if (writeStatic) {
      writeJsrStaticDeclaration(jsrName);
    }
    if (!m_clzType.isEmbededType()) {
      writeJsrResourceSpec(type);
    }
    if (!m_skip_methods) {
      writeConstructors(jsrName);
    }
    writeJsObjProtectedConstructor(jsrName);
    for (    IJsrGenListener listener : m_listeners) {
      listener.postConstructors(getWriter(),getStyle());
    }
  }
  if (!type.isMixin() && !m_skip_methods) {
    writeProps();
    writeProtos();
  }
  List<? extends IJstType> embededTypes=m_clzType.getEmbededTypes();
  if (!m_clzType.isMixin() && embededTypes.size() > 0) {
    writeNewline();
    for (    IJstType embededType : embededTypes) {
      if (!isSameGroup(m_clzType,embededType)) {
        continue;
      }
      if (!embededType.isMixin() && !embededType.getModifiers().isPrivate()) {
        writeNewline();
        JsrGenerator sibJsr=new JsrGenerator(getWriter(),getStyle(),m_config.getFilters());
        sibJsr.setNewline(getNewline());
        sibJsr.setInitialIndent(m_initialIndent + 1);
        sibJsr.writeJsr(embededType,this);
      }
    }
  }
  if (!m_skip_methods && needPrototype(m_clzType)) {
    writeTypeRef();
  }
  outdent();
  writeNewline();
  if (m_clzType.isEmbededType()) {
    writeIndent();
  }
  getWriter().append("String_Node_Str");
  return this;
}