Program: 168120
Project: 168120
Buggy source:
private String checkfiletype(String inputFilePath){
  File inputFile=new File(inputFilePath);
  Tika tika=new Tika();
  String mediaType=null;
  String fileName=inputFile.getName();
  String filePath=tempPPFileLoc + System.getProperty("String_Node_Str") + fileName.replace('.','_')+ "String_Node_Str";
  try {
    mediaType=tika.detect(inputFile);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  if (mediaType.equals("String_Node_Str")) {
    BodyContentHandler handler=new BodyContentHandler();
    Metadata metadata=new Metadata();
    ParseContext pcontext=new ParseContext();
    PDFParser pdfparser=new PDFParser();
    FileInputStream inputstream=null;
    try {
      inputstream=new FileInputStream(inputFile);
      pdfparser.parse(inputstream,handler,metadata,pcontext);
      BufferedWriter bw=new BufferedWriter(new FileWriter(filePath));
      bw.write(handler.toString());
      bw.close();
      inputstream.close();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return filePath;
  }
 else   if (mediaType.equals("String_Node_Str")) {
    BodyContentHandler handler=new BodyContentHandler();
    Metadata metadata=new Metadata();
    ParseContext pcontext=new ParseContext();
    RTFParser pdfparser=new RTFParser();
    FileInputStream inputstream=null;
    try {
      inputstream=new FileInputStream(inputFile);
      pdfparser.parse(inputstream,handler,metadata,pcontext);
      BufferedWriter bw=new BufferedWriter(new FileWriter(filePath));
      bw.write(handler.toString());
      bw.close();
      inputstream.close();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return filePath;
  }
 else {
  }
  return inputFilePath;
}

Fixed version (ground truth):
private String checkfiletype(String inputFilePath) throws TikaException {
  File inputFile=new File(inputFilePath);
  Tika tika=new Tika();
  String mediaType=null;
  String fileName=inputFile.getName();
  String filePath=tempPPFileLoc + System.getProperty("String_Node_Str") + fileName.replace('.','_')+ "String_Node_Str";
  try {
    TikaConfig config=new TikaConfig();
    Metadata metadata=new Metadata();
    metadata.set(Metadata.RESOURCE_NAME_KEY,inputFile.getAbsolutePath());
    mediaType=config.getDetector().detect(null,metadata).toString();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  if (mediaType.equals("String_Node_Str")) {
    BodyContentHandler handler=new BodyContentHandler();
    Metadata metadata=new Metadata();
    ParseContext pcontext=new ParseContext();
    PDFParser pdfparser=new PDFParser();
    FileInputStream inputstream=null;
    try {
      inputstream=new FileInputStream(inputFile);
      pdfparser.parse(inputstream,handler,metadata,pcontext);
      BufferedWriter bw=new BufferedWriter(new FileWriter(filePath));
      bw.write(handler.toString());
      bw.close();
      inputstream.close();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return filePath;
  }
 else   if (mediaType.equals("String_Node_Str")) {
    BodyContentHandler handler=new BodyContentHandler();
    Metadata metadata=new Metadata();
    ParseContext pcontext=new ParseContext();
    RTFParser pdfparser=new RTFParser();
    FileInputStream inputstream=null;
    try {
      inputstream=new FileInputStream(inputFile);
      pdfparser.parse(inputstream,handler,metadata,pcontext);
      BufferedWriter bw=new BufferedWriter(new FileWriter(filePath));
      bw.write(handler.toString());
      bw.close();
      inputstream.close();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return filePath;
  }
 else {
  }
  return inputFilePath;
}