Program: 170250
Project: 170250
Buggy source:
boolean generateCode(){
  fbpMode=false;
  langLabel=diag.diagLang.label;
  gl=diag.diagLang;
  changed=true;
  diag.fCPArr[DrawFBP.COMPONENT]=driver.new FileChooserParms(diag.diagLang.srcDirProp,"String_Node_Str" + diag.diagLang.showLangs() + "String_Node_Str",diag.diagLang.suggExtn,diag.diagLang.filter,"String_Node_Str" + diag.diagLang.showLangs() + "String_Node_Str"+ diag.diagLang.showSuffixes());
  diag.fCPArr[DrawFBP.GENCODE]=driver.new FileChooserParms(diag.diagLang.netDirProp,"String_Node_Str","String_Node_Str" + diag.diagLang.suggExtn,diag.diagLang.filter,diag.diagLang.label);
  String component=(langLabel.equals("String_Node_Str")) ? "String_Node_Str" : "String_Node_Str";
  String initialize=(langLabel.equals("String_Node_Str")) ? "String_Node_Str" : "String_Node_Str";
  String _port=(langLabel.equals("String_Node_Str")) ? "String_Node_Str" : "String_Node_Str";
  String sDO=(langLabel.equals("String_Node_Str")) ? "String_Node_Str" : "String_Node_Str";
  frame.setTitle("String_Node_Str" + diag.diagFile.getName());
  frame.setJMenuBar(createMenuBar());
  BufferedImage image=driver.loadImage("String_Node_Str");
  frame.setIconImage(image);
  String code="String_Node_Str";
  portNames=new HashSet<String>();
  blocklist=new HashMap<String,Integer>();
  ext="String_Node_Str";
  Style[] styles=new Style[20];
  for (  Block block : diag.blocks.values()) {
    if (block instanceof ExtPortBlock) {
      ext="String_Node_Str";
      if (block.description == null || block.description.equals("String_Node_Str")) {
        block.description="String_Node_Str";
        block.description=makeUniqueDesc(block.description);
      }
    }
  }
  if (langLabel.equals("String_Node_Str")) {
    packageName=driver.properties.get("String_Node_Str");
    if (packageName == null) {
      packageName=(String)MyOptionPane.showInputDialog(frame,"String_Node_Str",null);
      packageName=packageName.trim();
      driver.properties.put("String_Node_Str",packageName);
      driver.propertiesChanged=true;
    }
  }
  String[] contents;
  if (langLabel.equals("String_Node_Str")) {
    contents=new String[1];
    contents[0]=generateJSON();
    styles[0]=normalStyle;
  }
 else {
    contents=new String[20];
    if (langLabel.equals("String_Node_Str")) {
      contents[0]="String_Node_Str";
      contents[1]=packageName + "String_Node_Str";
    }
 else     contents[0]="String_Node_Str";
    contents[2]="String_Node_Str";
    if (langLabel.equals("String_Node_Str"))     contents[2]+="String_Node_Str";
    if (ext.equals("String_Node_Str"))     contents[3]=genMetadata(langLabel) + "String_Node_Str";
 else     contents[3]="String_Node_Str";
    contents[4]="String_Node_Str";
    contents[5]=diag.title;
    if (langLabel.equals("String_Node_Str"))     contents[6]="String_Node_Str";
 else     contents[6]="String_Node_Str";
    contents[7]=ext;
    if (langLabel.equals("String_Node_Str"))     contents[8]="String_Node_Str";
 else     contents[8]="String_Node_Str";
    if (diag.desc == null)     diag.desc="String_Node_Str";
    contents[9]="String_Node_Str" + diag.desc + "String_Node_Str";
    if (langLabel.equals("String_Node_Str"))     contents[10]="String_Node_Str";
 else     contents[10]="String_Node_Str";
    styles[0]=normalStyle;
    styles[1]=packageNameStyle;
    styles[2]=baseStyle;
    styles[3]=packageNameStyle;
    styles[4]=normalStyle;
    styles[5]=packageNameStyle;
    styles[6]=normalStyle;
    styles[7]=packageNameStyle;
    styles[8]=normalStyle;
    styles[9]=packageNameStyle;
    styles[10]=normalStyle;
    for (    Block block : diag.blocks.values()) {
      String t;
      if (block instanceof ComponentBlock) {
        if (block.description == null) {
          MyOptionPane.showMessageDialog(frame,"String_Node_Str");
          error=true;
          return false;
        }
        String s=cleanDesc(block);
        String c=cleanComp(block);
        if (block instanceof IIPBlock)         descArray.put(new Integer(block.id),block.description);
 else         descArray.put(new Integer(block.id),s);
        if (!block.multiplex)         code+=genComp(s,c,langLabel) + "String_Node_Str";
 else {
          if (block.mpxfactor == null) {
            String d=(String)MyOptionPane.showInputDialog(frame,"String_Node_Str" + "String_Node_Str" + block.description + "String_Node_Str","String_Node_Str",JOptionPane.QUESTION_MESSAGE);
            if (d == null || d.equals("String_Node_Str")) {
              block.mpxfactor="String_Node_Str";
              error=true;
            }
 else             block.mpxfactor=d;
            diag.changed=true;
          }
          frame.repaint();
          if (block.mpxfactor != null) {
            code+="String_Node_Str" + compress(s) + "String_Node_Str"+ block.mpxfactor+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ s+ "String_Node_Str";
          }
          code+="String_Node_Str" + compress(s) + "String_Node_Str";
          code+=genCompMpx(s,c,langLabel) + "String_Node_Str";
          if (c.equals("String_Node_Str")) {
            code+="String_Node_Str";
          }
          code+="String_Node_Str";
        }
      }
      if (block instanceof ExtPortBlock) {
        ExtPortBlock eb=(ExtPortBlock)block;
        String s="String_Node_Str";
        if (block.type.equals(Block.Types.EXTPORT_IN_BLOCK)) {
          s="String_Node_Str";
          if (eb.substreamSensitive)           t="String_Node_Str";
 else           t="String_Node_Str";
        }
 else         if (block.type.equals(Block.Types.EXTPORT_OUT_BLOCK)) {
          s="String_Node_Str";
          if (eb.substreamSensitive)           t="String_Node_Str";
 else           t="String_Node_Str";
        }
 else {
          s="String_Node_Str";
          t="String_Node_Str";
        }
        s=makeUniqueDesc(s);
        if (t.toLowerCase().endsWith("String_Node_Str"))         t=t.substring(0,t.length() - 6);
        code+=genComp(s,t,langLabel) + "String_Node_Str";
        code+=initialize + "String_Node_Str" + s+ "String_Node_Str"+ component+ "String_Node_Str"+ s+ "String_Node_Str"+ _port+ "String_Node_Str";
      }
    }
    for (    Arrow arrow : diag.arrows.values()) {
      Block from=diag.blocks.get(new Integer(arrow.fromId));
      Arrow a2=arrow.findTerminalArrow();
      if (a2 == null)       continue;
      Block to=diag.blocks.get(new Integer(a2.toId));
      if (to == null) {
        MyOptionPane.showMessageDialog(frame,"String_Node_Str");
        break;
      }
      if (from == null || to == null || from instanceof FileBlock || from instanceof ReportBlock || from instanceof LegendBlock || to instanceof FileBlock || to instanceof ReportBlock || to instanceof LegendBlock)       continue;
      if (!getPortNames(arrow))       return false;
      frame.repaint();
      String fromDesc=descArray.get(new Integer(arrow.fromId));
      String toDesc=descArray.get(new Integer(a2.toId));
      frame.repaint();
      String cap="String_Node_Str";
      if (arrow.capacity > 0)       cap="String_Node_Str" + arrow.capacity;
      if (from instanceof ComponentBlock && to instanceof ComponentBlock) {
        if (!arrow.endsAtLine && checkDupPort(dnPort,to)) {
          MyOptionPane.showMessageDialog(frame,"String_Node_Str" + dnPort);
          error=true;
        }
        if (checkDupPort(upPort,from)) {
          MyOptionPane.showMessageDialog(frame,"String_Node_Str" + upPort);
          error=true;
        }
        if (from.multiplex) {
          code+="String_Node_Str" + compress(fromDesc) + "String_Node_Str";
          code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ fromDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(upPort)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
          if (arrow.dropOldest)           code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
        }
 else         if (to.multiplex) {
          code+="String_Node_Str" + compress(toDesc) + "String_Node_Str";
          code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ q(fromDesc)+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(upPort)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
          if (arrow.dropOldest)           code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
        }
 else {
          code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ q(fromDesc)+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(upPort)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
          if (arrow.dropOldest)           code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
        }
      }
 else       if (from instanceof IIPBlock && to instanceof ComponentBlock) {
        if (!arrow.endsAtLine && checkDupPort(dnPort,to)) {
          MyOptionPane.showMessageDialog(frame,"String_Node_Str" + dnPort);
          error=true;
        }
        code+=initialize + "String_Node_Str" + q(fromDesc)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
      }
      if (from instanceof ExtPortBlock) {
        code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ q(fromDesc)+ "String_Node_Str"+ _port+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
        if (arrow.dropOldest)         code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
      }
 else       if (to instanceof ExtPortBlock) {
        code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ q(fromDesc)+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(upPort)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ "String_Node_Str"+ cap+ "String_Node_Str";
        if (arrow.dropOldest)         code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
      }
    }
    if (ext.equals("String_Node_Str")) {
      String s=diag.title;
      int i=s.indexOf("String_Node_Str");
      if (i > -1)       s=s.substring(0,i);
      code+="String_Node_Str";
      if (langLabel.equals("String_Node_Str"))       code+="String_Node_Str" + "String_Node_Str" + s + "String_Node_Str";
 else       code+="String_Node_Str" + "String_Node_Str" + s + "String_Node_Str";
    }
    code+="String_Node_Str";
    int sno=11;
    contents[sno]=code;
    styles[sno]=normalStyle;
    sno++;
    contents[sno]="String_Node_Str";
    styles[sno]=normalStyle;
    sno++;
    if (error) {
      contents[sno]="String_Node_Str" + "String_Node_Str";
      styles[sno]=errorStyle;
    }
  }
  try {
    for (int i=0; i < contents.length; i++) {
      if (contents[i] != null)       doc.insertString(doc.getLength(),contents[i],styles[i]);
    }
  }
 catch (  BadLocationException ble) {
    MyOptionPane.showMessageDialog(frame,"String_Node_Str");
    return false;
  }
  changed=true;
  colourCode();
  generated=true;
  nsLabel.setText("String_Node_Str");
  frame.repaint();
  return true;
}

Fixed version (ground truth):
boolean generateCode(){
  fbpMode=false;
  langLabel=diag.diagLang.label;
  gl=diag.diagLang;
  changed=true;
  diag.fCPArr[DrawFBP.COMPONENT]=driver.new FileChooserParms(diag.diagLang.srcDirProp,"String_Node_Str" + diag.diagLang.showLangs() + "String_Node_Str",diag.diagLang.suggExtn,diag.diagLang.filter,"String_Node_Str" + diag.diagLang.showLangs() + "String_Node_Str"+ diag.diagLang.showSuffixes());
  diag.fCPArr[DrawFBP.GENCODE]=driver.new FileChooserParms(diag.diagLang.netDirProp,"String_Node_Str","String_Node_Str" + diag.diagLang.suggExtn,diag.diagLang.filter,diag.diagLang.label);
  String component=(langLabel.equals("String_Node_Str")) ? "String_Node_Str" : "String_Node_Str";
  String initialize=(langLabel.equals("String_Node_Str")) ? "String_Node_Str" : "String_Node_Str";
  String _port=(langLabel.equals("String_Node_Str")) ? "String_Node_Str" : "String_Node_Str";
  String sDO=(langLabel.equals("String_Node_Str")) ? "String_Node_Str" : "String_Node_Str";
  frame.setTitle("String_Node_Str" + diag.diagFile.getName());
  frame.setJMenuBar(createMenuBar());
  BufferedImage image=driver.loadImage("String_Node_Str");
  frame.setIconImage(image);
  String code="String_Node_Str";
  portNames=new HashSet<String>();
  blocklist=new HashMap<String,Integer>();
  ext="String_Node_Str";
  Style[] styles=new Style[20];
  for (  Block block : diag.blocks.values()) {
    if (block instanceof ExtPortBlock) {
      ext="String_Node_Str";
      if (block.description == null || block.description.equals("String_Node_Str")) {
        block.description="String_Node_Str";
        block.description=makeUniqueDesc(block.description);
      }
    }
  }
  if (langLabel.equals("String_Node_Str")) {
    packageName=driver.properties.get("String_Node_Str");
    if (packageName == null) {
      packageName=(String)MyOptionPane.showInputDialog(frame,"String_Node_Str",null);
      packageName=packageName.trim();
      driver.properties.put("String_Node_Str",packageName);
      driver.propertiesChanged=true;
    }
  }
  String[] contents;
  if (langLabel.equals("String_Node_Str")) {
    contents=new String[1];
    contents[0]=generateJSON();
    styles[0]=normalStyle;
  }
 else {
    contents=new String[20];
    if (langLabel.equals("String_Node_Str")) {
      contents[0]="String_Node_Str";
      contents[1]=packageName + "String_Node_Str";
    }
 else     contents[0]="String_Node_Str";
    contents[2]="String_Node_Str";
    if (langLabel.equals("String_Node_Str"))     contents[2]+="String_Node_Str";
    if (ext.equals("String_Node_Str"))     contents[3]=genMetadata(langLabel) + "String_Node_Str";
 else     contents[3]="String_Node_Str";
    contents[4]="String_Node_Str";
    contents[5]=diag.title;
    if (langLabel.equals("String_Node_Str"))     contents[6]="String_Node_Str";
 else     contents[6]="String_Node_Str";
    contents[7]=ext;
    if (langLabel.equals("String_Node_Str"))     contents[8]="String_Node_Str";
 else     contents[8]="String_Node_Str";
    if (diag.desc == null)     diag.desc="String_Node_Str";
    contents[9]="String_Node_Str" + diag.desc + "String_Node_Str";
    if (langLabel.equals("String_Node_Str"))     contents[10]="String_Node_Str";
 else     contents[10]="String_Node_Str";
    styles[0]=normalStyle;
    styles[1]=packageNameStyle;
    styles[2]=baseStyle;
    styles[3]=packageNameStyle;
    styles[4]=normalStyle;
    styles[5]=packageNameStyle;
    styles[6]=normalStyle;
    styles[7]=packageNameStyle;
    styles[8]=normalStyle;
    styles[9]=packageNameStyle;
    styles[10]=normalStyle;
    for (    Block block : diag.blocks.values()) {
      String t;
      if (block instanceof ComponentBlock) {
        if (block.description == null) {
          MyOptionPane.showMessageDialog(frame,"String_Node_Str");
          error=true;
          return false;
        }
        String s=cleanDesc(block);
        String c=cleanComp(block);
        descArray.put(new Integer(block.id),s);
        if (!block.multiplex)         code+=genComp(s,c,langLabel) + "String_Node_Str";
 else {
          if (block.mpxfactor == null) {
            String d=(String)MyOptionPane.showInputDialog(frame,"String_Node_Str" + "String_Node_Str" + block.description + "String_Node_Str","String_Node_Str",JOptionPane.QUESTION_MESSAGE);
            if (d == null || d.equals("String_Node_Str")) {
              block.mpxfactor="String_Node_Str";
              error=true;
            }
 else             block.mpxfactor=d;
            diag.changed=true;
          }
          frame.repaint();
          if (block.mpxfactor != null) {
            code+="String_Node_Str" + compress(s) + "String_Node_Str"+ block.mpxfactor+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ s+ "String_Node_Str";
          }
          code+="String_Node_Str" + compress(s) + "String_Node_Str";
          code+=genCompMpx(s,c,langLabel) + "String_Node_Str";
          if (c.equals("String_Node_Str")) {
            code+="String_Node_Str";
          }
          code+="String_Node_Str";
        }
      }
      if (block instanceof ExtPortBlock) {
        ExtPortBlock eb=(ExtPortBlock)block;
        String s="String_Node_Str";
        if (block.type.equals(Block.Types.EXTPORT_IN_BLOCK)) {
          s="String_Node_Str";
          if (eb.substreamSensitive)           t="String_Node_Str";
 else           t="String_Node_Str";
        }
 else         if (block.type.equals(Block.Types.EXTPORT_OUT_BLOCK)) {
          s="String_Node_Str";
          if (eb.substreamSensitive)           t="String_Node_Str";
 else           t="String_Node_Str";
        }
 else {
          s="String_Node_Str";
          t="String_Node_Str";
        }
        s=makeUniqueDesc(s);
        if (t.toLowerCase().endsWith("String_Node_Str"))         t=t.substring(0,t.length() - 6);
        code+=genComp(s,t,langLabel) + "String_Node_Str";
        code+=initialize + "String_Node_Str" + s+ "String_Node_Str"+ component+ "String_Node_Str"+ s+ "String_Node_Str"+ _port+ "String_Node_Str";
      }
      if (block instanceof IIPBlock)       descArray.put(new Integer(block.id),block.description);
    }
    for (    Arrow arrow : diag.arrows.values()) {
      Block from=diag.blocks.get(new Integer(arrow.fromId));
      Arrow a2=arrow.findTerminalArrow();
      if (a2 == null)       continue;
      Block to=diag.blocks.get(new Integer(a2.toId));
      if (to == null) {
        MyOptionPane.showMessageDialog(frame,"String_Node_Str");
        break;
      }
      if (from == null || to == null || from instanceof FileBlock || from instanceof ReportBlock || from instanceof LegendBlock || to instanceof FileBlock || to instanceof ReportBlock || to instanceof LegendBlock)       continue;
      if (!getPortNames(arrow))       return false;
      frame.repaint();
      String fromDesc=descArray.get(new Integer(arrow.fromId));
      String toDesc=descArray.get(new Integer(a2.toId));
      frame.repaint();
      String cap="String_Node_Str";
      if (arrow.capacity > 0)       cap="String_Node_Str" + arrow.capacity;
      if (from instanceof ComponentBlock && to instanceof ComponentBlock) {
        if (!arrow.endsAtLine && checkDupPort(dnPort,to)) {
          MyOptionPane.showMessageDialog(frame,"String_Node_Str" + dnPort);
          error=true;
        }
        if (checkDupPort(upPort,from)) {
          MyOptionPane.showMessageDialog(frame,"String_Node_Str" + upPort);
          error=true;
        }
        if (from.multiplex) {
          code+="String_Node_Str" + compress(fromDesc) + "String_Node_Str";
          code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ fromDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(upPort)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
          if (arrow.dropOldest)           code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
        }
 else         if (to.multiplex) {
          code+="String_Node_Str" + compress(toDesc) + "String_Node_Str";
          code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ q(fromDesc)+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(upPort)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
          if (arrow.dropOldest)           code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
        }
 else {
          code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ q(fromDesc)+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(upPort)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
          if (arrow.dropOldest)           code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
        }
      }
 else       if (from instanceof IIPBlock && to instanceof ComponentBlock) {
        if (!arrow.endsAtLine && checkDupPort(dnPort,to)) {
          MyOptionPane.showMessageDialog(frame,"String_Node_Str" + dnPort);
          error=true;
        }
        code+=initialize + "String_Node_Str" + q(fromDesc)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
      }
      if (from instanceof ExtPortBlock) {
        code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ q(fromDesc)+ "String_Node_Str"+ _port+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(dnPort)+ "String_Node_Str"+ cap+ "String_Node_Str";
        if (arrow.dropOldest)         code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
      }
 else       if (to instanceof ExtPortBlock) {
        code+=genConnect(arrow) + "String_Node_Str" + component+ "String_Node_Str"+ q(fromDesc)+ "String_Node_Str"+ _port+ "String_Node_Str"+ q(upPort)+ "String_Node_Str"+ component+ "String_Node_Str"+ toDesc+ "String_Node_Str"+ _port+ "String_Node_Str"+ "String_Node_Str"+ cap+ "String_Node_Str";
        if (arrow.dropOldest)         code+="String_Node_Str" + arrow.id + "String_Node_Str"+ sDO+ "String_Node_Str";
      }
    }
    if (ext.equals("String_Node_Str")) {
      String s=diag.title;
      int i=s.indexOf("String_Node_Str");
      if (i > -1)       s=s.substring(0,i);
      code+="String_Node_Str";
      if (langLabel.equals("String_Node_Str"))       code+="String_Node_Str" + "String_Node_Str" + s + "String_Node_Str";
 else       code+="String_Node_Str" + "String_Node_Str" + s + "String_Node_Str";
    }
    code+="String_Node_Str";
    int sno=11;
    contents[sno]=code;
    styles[sno]=normalStyle;
    sno++;
    contents[sno]="String_Node_Str";
    styles[sno]=normalStyle;
    sno++;
    if (error) {
      contents[sno]="String_Node_Str" + "String_Node_Str";
      styles[sno]=errorStyle;
    }
  }
  try {
    for (int i=0; i < contents.length; i++) {
      if (contents[i] != null)       doc.insertString(doc.getLength(),contents[i],styles[i]);
    }
  }
 catch (  BadLocationException ble) {
    MyOptionPane.showMessageDialog(frame,"String_Node_Str");
    return false;
  }
  changed=true;
  colourCode();
  generated=true;
  nsLabel.setText("String_Node_Str");
  frame.repaint();
  return true;
}