Program: 39475
Project: 39475
Buggy source:
/** 
 * Converts HTML obtained from an <code>InputStream</code> to a <code>List</code> of iText objects (<code>IElement</code> instances), using specific <code>ConverterProperties</code>.
 * @param htmlStream the <code>InputStream</code> with the source HTML
 * @param converterProperties a <code>ConverterProperties</code> instance
 * @return a list of iText building blocks
 * @throws IOException Signals that an I/O exception has occurred.
 */
public static List<IElement> convertToElements(InputStream htmlStream,ConverterProperties converterProperties) throws IOException {
  String licenseKeyClassName="String_Node_Str";
  String licenseKeyProductClassName="String_Node_Str";
  String licenseKeyFeatureClassName="String_Node_Str";
  String checkLicenseKeyMethodName="String_Node_Str";
  try {
    Class licenseKeyClass=Class.forName(licenseKeyClassName);
    Class licenseKeyProductClass=Class.forName(licenseKeyProductClassName);
    Class licenseKeyProductFeatureClass=Class.forName(licenseKeyFeatureClassName);
    Object licenseKeyProductFeatureArray=Array.newInstance(licenseKeyProductFeatureClass,0);
    Class[] params=new Class[]{String.class,Integer.TYPE,Integer.TYPE,licenseKeyProductFeatureArray.getClass()};
    Constructor licenseKeyProductConstructor=licenseKeyProductClass.getConstructor(params);
    Object licenseKeyProductObject=licenseKeyProductConstructor.newInstance(Html2PdfProductInfo.PRODUCT_NAME,Html2PdfProductInfo.MAJOR_VERSION,Html2PdfProductInfo.MINOR_VERSION,licenseKeyProductFeatureArray);
    Method method=licenseKeyClass.getMethod(checkLicenseKeyMethodName,licenseKeyProductClass);
    method.invoke(null,licenseKeyProductObject);
  }
 catch (  Exception e) {
    if (!Version.isAGPLVersion()) {
      throw new RuntimeException(e.getCause());
    }
  }
  IHtmlParser parser=new JsoupHtmlParser();
  IDocumentNode doc=parser.parse(htmlStream,detectEncoding(htmlStream));
  return Attacher.attach(doc,converterProperties);
}

Fixed version (ground truth):
/** 
 * Converts HTML obtained from an   {@link InputStream} to a {@link List} ofiText objects ( {@link IElement} instances), using specific{@link ConverterProperties}.
 * @param htmlStream the {@link InputStream} with the source HTML
 * @param converterProperties a {@link ConverterProperties} instance
 * @return a list of iText building blocks
 * @throws IOException Signals that an I/O exception has occurred.
 */
public static List<IElement> convertToElements(InputStream htmlStream,ConverterProperties converterProperties) throws IOException {
  String licenseKeyClassName="String_Node_Str";
  String licenseKeyProductClassName="String_Node_Str";
  String licenseKeyFeatureClassName="String_Node_Str";
  String checkLicenseKeyMethodName="String_Node_Str";
  try {
    Class licenseKeyClass=Class.forName(licenseKeyClassName);
    Class licenseKeyProductClass=Class.forName(licenseKeyProductClassName);
    Class licenseKeyProductFeatureClass=Class.forName(licenseKeyFeatureClassName);
    Object licenseKeyProductFeatureArray=Array.newInstance(licenseKeyProductFeatureClass,0);
    Class[] params=new Class[]{String.class,Integer.TYPE,Integer.TYPE,licenseKeyProductFeatureArray.getClass()};
    Constructor licenseKeyProductConstructor=licenseKeyProductClass.getConstructor(params);
    Object licenseKeyProductObject=licenseKeyProductConstructor.newInstance(Html2PdfProductInfo.PRODUCT_NAME,Html2PdfProductInfo.MAJOR_VERSION,Html2PdfProductInfo.MINOR_VERSION,licenseKeyProductFeatureArray);
    Method method=licenseKeyClass.getMethod(checkLicenseKeyMethodName,licenseKeyProductClass);
    method.invoke(null,licenseKeyProductObject);
  }
 catch (  Exception e) {
    if (!Version.isAGPLVersion()) {
      throw new RuntimeException(e.getCause());
    }
  }
  IHtmlParser parser=new JsoupHtmlParser();
  IDocumentNode doc=parser.parse(htmlStream,detectEncoding(htmlStream));
  return Attacher.attach(doc,converterProperties);
}