Buggy code:
public class HtmlFeatureParser extends AbstractParser { private static final long serialVersionUID = 1631417895901342813L ; private static Log log = LogFactory . getLog ( HtmlFeatureParser . class ) ; private static final Set < MediaType > SUPPORTED_TYPES = Collections . unmodifiableSet ( new HashSet < MediaType > ( Arrays . asList ( MediaType . text ( "html" ) , MediaType . application ( "xhtml" ) ) ) ) ; private Parser parser = Parser . xmlParser ( ) ; private int max_errors ; public static final String ORIGINAL_PUB_DATE = "OriginalPublicationDate" ; public static final String LINK_LIST = "LinkList" ; public static final Property LINKS = Property . internalTextBag ( "LINK-LIST" ) ; public static final String FIRST_PARAGRAPH = "FirstParagraph" ; public static final Property DISTINCT_ELEMENTS = Property . internalTextBag ( "DISTINCT-ELEMENTS" ) ; public static final Property NUM_PARSE_ERRORS = Property . internalInteger ( "Html-Parse-Error-Count" ) ; public static final int DEFAULT_MAX_PARSE_ERRORS = 1000 ; public HtmlFeatureParser ( ) { } public void setMaxParseErrors ( int max_errors ) { } public int getMaxParseErrors ( ) { } public List < ParseError > getParseErrors ( ) { } @ Override public Set < MediaType > getSupportedTypes ( ParseContext context ) { } @ Override public void parse ( InputStream stream , ContentHandler handler , Metadata metadata , ParseContext context ) throws IOException , TikaException , SAXException { final long start = System . nanoTime ( ) ; String url = metadata . get ( RESOURCE_NAME_KEY ) ; Document doc = null ; try { doc = Jsoup . parse ( stream , null , url , parser ) ; } catch ( IllegalCharsetNameException e ) { HtmlFeatureParser . log . warn ( ( "Jsoup<seq2seq4repair_space>parse<seq2seq4repair_space>had<seq2seq4repair_space>to<seq2seq4repair_space>assume<seq2seq4repair_space>UTF-8:<seq2seq4repair_space>" + e ) ) ; doc = Jsoup . parse ( stream , "UTF-8" , url ) ; } catch ( Exception e ) { HtmlFeatureParser . log . error ( ( "Jsoup<seq2seq4repair_space>parse<seq2seq4repair_space>failed:<seq2seq4repair_space>" + e ) ) ; } finally { if ( doc == null ) return ; } Instrument . timeRel ( "HTMLAnalyzer.analyze#parser" , "HtmlFeatureParser.parse#jsoupparse" , start ) ; <START_BUG> final long nonJsoupStart = System . currentTimeMillis ( ) ; <END_BUG> metadata . set ( HtmlFeatureParser . NUM_PARSE_ERRORS , parser . getErrors ( ) . size ( ) ) ; Set < String > links = this . extractLinks ( doc , false ) ; if ( ( links != null ) && ( ( links . size ( ) ) > 0 ) ) metadata . set ( HtmlFeatureParser . LINK_LIST , StringUtils . join ( links , "<seq2seq4repair_space>" ) ) ; for ( Element meta : doc . select ( "meta[name=OriginalPublicationDate]" ) ) { metadata . set ( HtmlFeatureParser . ORIGINAL_PUB_DATE , meta . attr ( "content" ) ) ; } for ( Element p : doc . select ( "p" ) ) { String pt = p . text ( ) ; if ( pt != null ) { pt = pt . trim ( ) ; if ( ( pt . length ( ) ) > 0 ) { metadata . set ( HtmlFeatureParser . FIRST_PARAGRAPH , p . text ( ) ) ; break ; } } } Set < String > de = new HashSet < String > ( ) ; for ( Element e : doc . select ( "*" ) ) { if ( ! ( "#root" . equals ( e . tag ( ) . getName ( ) ) ) ) de . add ( StringUtils . left ( e . tag ( ) . getName ( ) , 100 ) ) ; } for ( Element e : doc . select ( "link" ) ) { de . add ( ( "link//@rel=" + ( e . attr ( "rel" ) ) ) ) ; } metadata . set ( HtmlFeatureParser . DISTINCT_ELEMENTS , de . toArray ( new String [ ] { } ) ) ; for ( Element a : doc . select ( "a[rel=license]" ) ) { metadata . add ( LICENSE_URL , a . attr ( "href" ) ) ; } for ( Element a : doc . select ( "link[rel=license]" ) ) { metadata . add ( LICENSE_URL , a . attr ( "href" ) ) ; } for ( Element a : doc . select ( "area[rel=license]" ) ) { metadata . add ( LICENSE_URL , a . attr ( "href" ) ) ; } Instrument . timeRel ( "HTMLAnalyzer.analyze#parser" , "HtmlFeatureParser.parse#featureextract" , nonJsoupStart ) ; } private Set < String > extractLinks ( Document doc , boolean includeImgLinks ) throws IOException { } public static Metadata extractMetadata ( InputStream in , String url ) { } }

Fix:
final long nonJsoupStart = System . nanoTime ( ) ;