Program: 142325
Project: 142325
Buggy source:
public void setAVT(String displayText,String audioURI,String imageURI){
  this.removeAllViews();
  String mDisplayText=displayText;
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mTextView=(TextView)inflater.inflate(R.layout.entity_item_text,null);
  mTextView.setText(displayText);
  RelativeLayout.LayoutParams textParams=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  RelativeLayout.LayoutParams audioParams=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  RelativeLayout.LayoutParams imageParams=new RelativeLayout.LayoutParams(imageDimension,imageDimension);
  String audioFilename="String_Node_Str";
  if (audioURI != null && !audioURI.equals("String_Node_Str")) {
    try {
      audioFilename=ReferenceManager._().DeriveReference(audioURI).getLocalURI();
    }
 catch (    InvalidReferenceException e) {
      Log.e(t,"String_Node_Str");
      e.printStackTrace();
    }
  }
  File audioFile=new File(audioFilename);
  if (audioFilename != "String_Node_Str" && audioFile.exists()) {
    mAudioButton=new AudioButton(getContext(),audioURI);
    mAudioButton.setId(3245345);
    mAudioButton.setFocusable(false);
    mAudioButton.setFocusableInTouchMode(false);
    audioParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
    audioParams.addRule(CENTER_VERTICAL);
    addView(mAudioButton,audioParams);
  }
  String errorMsg=null;
  if (imageURI != null && !imageURI.equals("String_Node_Str")) {
    try {
      String imageFilename=ReferenceManager._().DeriveReference(imageURI).getLocalURI();
      final File imageFile=new File(imageFilename);
      if (imageFile.exists()) {
        Bitmap b=null;
        try {
          Display display=((WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
          int screenWidth=display.getWidth();
          int screenHeight=display.getHeight();
          b=FileUtils.getBitmapScaledToDisplay(imageFile,screenHeight,screenWidth);
        }
 catch (        OutOfMemoryError e) {
          errorMsg="String_Node_Str" + e.getMessage();
        }
        if (b != null) {
          mImageView=new ImageView(getContext());
          mImageView.setPadding(10,10,10,10);
          mImageView.setAdjustViewBounds(true);
          mImageView.setImageBitmap(b);
          mImageView.setId(23422634);
          imageParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
          addView(mImageView,imageParams);
        }
 else         if (errorMsg == null) {
          errorMsg=getContext().getString(R.string.file_invalid,imageFile);
        }
      }
 else       if (errorMsg == null) {
        errorMsg=getContext().getString(R.string.file_missing,imageFile);
      }
    }
 catch (    InvalidReferenceException e) {
      Log.e(t,"String_Node_Str");
      e.printStackTrace();
    }
  }
  textParams.addRule(RelativeLayout.CENTER_VERTICAL);
  textParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
  if (imageURI != null && !imageURI.equals("String_Node_Str") && mImageView != null) {
    textParams.addRule(RelativeLayout.RIGHT_OF,mImageView.getId());
  }
 else {
    textParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
  }
  if (mAudioButton != null) {
    textParams.addRule(RelativeLayout.LEFT_OF,mAudioButton.getId());
  }
  addView(mTextView,textParams);
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void setAVT(String displayText,String audioURI,String imageURI){
  this.removeAllViews();
  String mDisplayText=displayText;
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mTextView=(TextView)inflater.inflate(R.layout.entity_item_text,null);
  mTextView.setText(displayText);
  RelativeLayout.LayoutParams textParams=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  RelativeLayout.LayoutParams audioParams=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  RelativeLayout.LayoutParams imageParams=new RelativeLayout.LayoutParams(imageDimension,imageDimension);
  String audioFilename="String_Node_Str";
  if (audioURI != null && !audioURI.equals("String_Node_Str")) {
    try {
      audioFilename=ReferenceManager._().DeriveReference(audioURI).getLocalURI();
    }
 catch (    InvalidReferenceException e) {
      Log.e(t,"String_Node_Str");
      e.printStackTrace();
    }
  }
  File audioFile=new File(audioFilename);
  if (audioFilename != "String_Node_Str" && audioFile.exists()) {
    mAudioButton=new AudioButton(getContext(),audioURI);
    mAudioButton.setId(3245345);
    mAudioButton.setFocusable(false);
    mAudioButton.setFocusableInTouchMode(false);
    audioParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
    audioParams.addRule(CENTER_VERTICAL);
    addView(mAudioButton,audioParams);
  }
  String errorMsg=null;
  if (imageURI != null && !imageURI.equals("String_Node_Str")) {
    try {
      String imageFilename=ReferenceManager._().DeriveReference(imageURI).getLocalURI();
      final File imageFile=new File(imageFilename);
      if (imageFile.exists()) {
        Bitmap b=null;
        try {
          Display display=((WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
          int screenWidth=display.getWidth();
          int screenHeight=display.getHeight();
          b=FileUtils.getBitmapScaledToDisplay(imageFile,screenHeight,screenWidth);
        }
 catch (        OutOfMemoryError e) {
          errorMsg="String_Node_Str" + e.getMessage();
        }
        if (b != null) {
          mImageView=new ImageView(getContext());
          mImageView.setPadding(10,10,10,10);
          mImageView.setAdjustViewBounds(true);
          mImageView.setImageBitmap(b);
          mImageView.setId(23422634);
          imageParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
          addView(mImageView,imageParams);
        }
 else         if (errorMsg == null) {
          errorMsg=getContext().getString(R.string.file_invalid,imageFile);
        }
      }
 else       if (errorMsg == null) {
        errorMsg=getContext().getString(R.string.file_missing,imageFile);
      }
    }
 catch (    InvalidReferenceException e) {
      Log.e(t,"String_Node_Str");
      e.printStackTrace();
    }
  }
  textParams.addRule(RelativeLayout.CENTER_VERTICAL);
  textParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
  if (imageURI != null && !imageURI.equals("String_Node_Str") && mImageView != null) {
    textParams.addRule(RelativeLayout.RIGHT_OF,mImageView.getId());
  }
 else {
    textParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
  }
  if (mAudioButton != null) {
    textParams.addRule(RelativeLayout.LEFT_OF,mAudioButton.getId());
  }
  addView(mTextView,textParams);
}