Program: 88653
Project: 88653
Buggy source:
/** 
 * Create DocBook paragraph(s) for this Paragraph.
 * @param forViewEditor
 * @param outputDir
 * @return Return one or more DBParagraphs for docgen or the view editorbased on properties of the Paragraph UML stereotype. <p> <code> O=tryOcl && T=gotText && R=gotTargets && S=gotStereotypeProperties && D=don't care <br><br> 1 &nbsp;D && !T && !R &&  D: return nothing <br> 2     !O && !T &&  R && !S: return a paragraph of documentation for each target <br> 3     !O && !T &&  R &&  S: return a paragraph for each target-property pair  <br> 4     !O &&  T &&  D &&  D: return a paragraph of the text, tied to an attribute (the Documentation attribute as set from parseView) of dgElement <br>  <br> 5 &nbsp;O && !T &&  R && !S: return a paragraph of the evaluation of the documentation of each target as OCL on dgElement <br> 6 &nbsp;O && !T &&  R &&  S: return a paragraph of the evaluation of each target-property as OCL on dgElement <br> 7 &nbsp;O &&  T && !R &&  D: return a paragraph of the evaluation of the text as OCL on dgElement <br> 8 &nbsp;O &&  T &&  R && !S: return a paragraph of the evaluation of the text as OCL on each target <br> 9 &nbsp;O &&  T &&  R &&  S: return a paragraph of the evaluation of the text as OCL on each target-property pair <br> </code> <p>
 * @see gov.nasa.jpl.mbee.model.Query#visit(boolean,java.lang.String)
 */
@Override public List<DocumentElement> visit(boolean forViewEditor,String outputDir){
  System.out.println("String_Node_Str" + forViewEditor + "String_Node_Str"+ outputDir+ "String_Node_Str");
  List<DocumentElement> res=new ArrayList<DocumentElement>();
  List<Reference> refs=new ArrayList<Reference>();
  if (getIgnore())   return res;
  boolean gotText=getText() != null;
  boolean gotTargets=getTargets() != null;
  boolean gotStereotypeProperties=!Utils2.isNullOrEmpty(getStereotypeProperties());
  System.out.println("String_Node_Str" + gotText + "String_Node_Str"+ getText());
  System.out.println("String_Node_Str" + gotTargets + "String_Node_Str"+ MoreToString.Helper.toLongString(getTargets()));
  System.out.println("String_Node_Str" + gotStereotypeProperties + "String_Node_Str"+ getStereotypeProperties());
  System.out.println("String_Node_Str" + attribute);
  if (gotText && !tryOcl) {
    System.out.println("String_Node_Str");
    if (forViewEditor || !getText().trim().equals("String_Node_Str"))     res.add(new DBParagraph(getText(),getDgElement(),getFrom()));
  }
 else   if (gotText && !gotTargets) {
    System.out.println("String_Node_Str");
    addOclParagraph(res,getText(),dgElement);
  }
 else   if (gotTargets) {
    for (    Object o : targets) {
      Element e=null;
      if (o instanceof Element) {
        e=(Element)o;
      }
 else       if (!tryOcl)       continue;
      Reference ref=null;
      if (gotStereotypeProperties) {
        System.out.println("String_Node_Str" + o);
        for (        Property p : getStereotypeProperties()) {
          ref=Reference.getPropertyReference(e,p);
          refs.add(ref);
        }
      }
 else {
        if (tryOcl && gotText) {
          System.out.println("String_Node_Str" + Utils.getName(o));
          ref=new Reference(o);
        }
 else {
          System.out.println("String_Node_Str");
          ref=new Reference(e,From.DOCUMENTATION,ModelHelper.getComment(e));
        }
        refs.add(ref);
      }
    }
    if (tryOcl && !iterate && gotText) {
      System.out.println("String_Node_Str");
      ArrayList<Object> results=new ArrayList<Object>();
      for (      Reference r : refs) {
        results.add(r.getResult());
      }
      addOclParagraph(res,getText(),results);
    }
 else {
      if (!iterate) {
        Debug.error(false,"String_Node_Str" + dgElement);
      }
      for (      Reference r : refs) {
        if (!tryOcl) {
          System.out.println("String_Node_Str" + r);
          res.add(new DBParagraph(r.getResult(),r.getElement(),r.getFrom()));
        }
 else {
          if (gotText) {
            System.out.println("String_Node_Str" + r);
            addOclParagraph(res,getText(),r.getResult());
          }
 else {
            System.out.println("String_Node_Str" + r);
            addOclParagraph(res,r.getResult(),dgElement);
          }
        }
      }
    }
  }
  System.out.println("String_Node_Str" + forViewEditor + "String_Node_Str"+ outputDir+ "String_Node_Str"+ res);
  return res;
}

Fixed version (ground truth):
/** 
 * Create DocBook paragraph(s) for this Paragraph.
 * @param forViewEditor
 * @param outputDir
 * @return Return one or more DBParagraphs for docgen or the view editorbased on properties of the Paragraph UML stereotype. <p> <code> O=tryOcl && T=gotText && R=gotTargets && S=gotStereotypeProperties && D=don't care <br><br> 1 &nbsp;D && !T && !R &&  D: return nothing <br> 2     !O && !T &&  R && !S: return a paragraph of documentation for each target <br> 3     !O && !T &&  R &&  S: return a paragraph for each target-property pair  <br> 4     !O &&  T &&  D &&  D: return a paragraph of the text, tied to the "body" slot of dgElement <br>  <br> 5 &nbsp;O && !T &&  R && !S: return a paragraph of the evaluation of the documentation of each target as OCL on dgElement <br> 6 &nbsp;O && !T &&  R &&  S: return a paragraph of the evaluation of each target-property as OCL on dgElement <br> 7 &nbsp;O &&  T && !R &&  D: return a paragraph of the evaluation of the text as OCL on dgElement <br> 8 &nbsp;O &&  T &&  R && !S: return a paragraph of the evaluation of the text as OCL on each target <br> 9 &nbsp;O &&  T &&  R &&  S: return a paragraph of the evaluation of the text as OCL on each target-property pair <br> </code> <p>
 * @see gov.nasa.jpl.mbee.model.Query#visit(boolean,java.lang.String)
 */
@Override public List<DocumentElement> visit(boolean forViewEditor,String outputDir){
  System.out.println("String_Node_Str" + forViewEditor + "String_Node_Str"+ outputDir+ "String_Node_Str");
  List<DocumentElement> res=new ArrayList<DocumentElement>();
  List<Reference> refs=new ArrayList<Reference>();
  if (getIgnore())   return res;
  boolean gotText=getText() != null;
  boolean gotTargets=getTargets() != null;
  boolean gotStereotypeProperties=!Utils2.isNullOrEmpty(getStereotypeProperties());
  System.out.println("String_Node_Str" + gotText + "String_Node_Str"+ getText());
  System.out.println("String_Node_Str" + gotTargets + "String_Node_Str"+ MoreToString.Helper.toLongString(getTargets()));
  System.out.println("String_Node_Str" + gotStereotypeProperties + "String_Node_Str"+ getStereotypeProperties());
  System.out.println("String_Node_Str" + attribute);
  if (gotText && !tryOcl) {
    System.out.println("String_Node_Str");
    if (forViewEditor || !getText().trim().equals("String_Node_Str")) {
      Stereotype paragraphStereotype=Utils.getStereotype(DocGen3Profile.paragraphStereotype);
      Slot s=Utils.getSlot(getDgElement(),Utils.getStereotypePropertyByName(paragraphStereotype,"String_Node_Str"));
      res.add(new DBParagraph(getText(),s,From.DVALUE));
    }
 else {
      res.add(new DBParagraph(getText()));
    }
  }
 else   if (gotText && !gotTargets) {
    System.out.println("String_Node_Str");
    addOclParagraph(res,getText(),dgElement);
  }
 else   if (gotTargets) {
    for (    Object o : targets) {
      Element e=null;
      if (o instanceof Element) {
        e=(Element)o;
      }
 else       if (!tryOcl)       continue;
      Reference ref=null;
      if (gotStereotypeProperties) {
        System.out.println("String_Node_Str" + o);
        for (        Property p : getStereotypeProperties()) {
          ref=Reference.getPropertyReference(e,p);
          refs.add(ref);
        }
      }
 else {
        if (tryOcl && gotText) {
          System.out.println("String_Node_Str" + Utils.getName(o));
          ref=new Reference(o);
        }
 else {
          System.out.println("String_Node_Str");
          ref=new Reference(e,From.DOCUMENTATION,ModelHelper.getComment(e));
        }
        refs.add(ref);
      }
    }
    if (tryOcl && !iterate && gotText) {
      System.out.println("String_Node_Str");
      ArrayList<Object> results=new ArrayList<Object>();
      for (      Reference r : refs) {
        results.add(r.getResult());
      }
      addOclParagraph(res,getText(),results);
    }
 else {
      if (!iterate) {
        Debug.error(false,"String_Node_Str" + dgElement);
      }
      for (      Reference r : refs) {
        if (!tryOcl) {
          System.out.println("String_Node_Str" + r);
          res.addAll(Common.getReferenceAsDocumentElements(r));
        }
 else {
          if (gotText) {
            System.out.println("String_Node_Str" + r);
            addOclParagraph(res,getText(),r.getResult());
          }
 else {
            System.out.println("String_Node_Str" + r);
            addOclParagraph(res,r.getResult(),dgElement);
          }
        }
      }
    }
  }
  System.out.println("String_Node_Str" + forViewEditor + "String_Node_Str"+ outputDir+ "String_Node_Str"+ res);
  return res;
}