Buggy code:
public class FetcherBolt extends BaseRichBolt { public static final Logger LOG = LoggerFactory . getLogger ( FetcherBolt . class ) ; private final AtomicInteger activeThreads = new AtomicInteger ( 0 ) ; private final AtomicInteger spinWaiting = new AtomicInteger ( 0 ) ; private Config conf ; private FetcherBolt . FetchItemQueues fetchQueues ; private OutputCollector _collector ; private MultiCountMetric eventCounter ; private MultiCountMetric metricGauge ; private ProtocolFactory protocolFactory ; private final List < Tuple > ackQueue = Collections . synchronizedList ( new LinkedList < Tuple > ( ) ) ; private final List < Object [ ] > emitQueue = Collections . synchronizedList ( new LinkedList < Object [ ] > ( ) ) ; private int taskIndex = - 1 ; private URLFilterUtil parentURLFilter ; private URLFilters urlFilters ; private boolean allowRedirs ; private MetadataTransfer metadataTransfer ; private static class FetchItem { String queueID ; String url ; URL u ; Tuple t ; public FetchItem ( String url , URL u , Tuple t , String queueID ) { } public static FetcherBolt . FetchItem create ( Tuple t , String queueMode ) { } } private static class FetchItemQueue { Deque < FetcherBolt . FetchItem > queue = new LinkedBlockingDeque < FetcherBolt . FetchItem > ( ) ; AtomicInteger inProgress = new AtomicInteger ( ) ; AtomicLong nextFetchTime = new AtomicLong ( ) ; long crawlDelay ; final long minCrawlDelay ; final int maxThreads ; public FetchItemQueue ( Config conf , int maxThreads , long crawlDelay , long minCrawlDelay ) { } public int getQueueSize ( ) { } public int getInProgressSize ( ) { } public void finishFetchItem ( FetcherBolt . FetchItem it , boolean asap ) { } public boolean addFetchItem ( FetcherBolt . FetchItem it ) { } public FetcherBolt . FetchItem getFetchItem ( ) { } private void setEndTime ( long endTime ) { } private void setEndTime ( long endTime , boolean asap ) { } } private static class FetchItemQueues { Map < String , FetcherBolt . FetchItemQueue > queues = new LinkedHashMap < String , FetcherBolt . FetchItemQueue > ( ) ; Iterator < String > it = Iterables . cycle ( queues . keySet ( ) ) . iterator ( ) ; AtomicInteger inQueues = new AtomicInteger ( 0 ) ; final int maxThreads ; final long crawlDelay ; final long minCrawlDelay ; final Config conf ; public static final String QUEUE_MODE_HOST = "byHost" ; public static final String QUEUE_MODE_DOMAIN = "byDomain" ; public static final String QUEUE_MODE_IP = "byIP" ; String queueMode ; public FetchItemQueues ( Config conf ) { } public synchronized void addFetchItem ( Tuple input ) { } public synchronized void addFetchItem ( FetcherBolt . FetchItem it ) { } public synchronized void finishFetchItem ( FetcherBolt . FetchItem it , boolean asap ) { } public synchronized FetcherBolt . FetchItemQueue getFetchItemQueue ( String id ) { } public synchronized FetcherBolt . FetchItem getFetchItem ( ) { } } private class FetcherThread extends Thread { private final long maxCrawlDelay ; public FetcherThread ( Config conf ) { } @ Override public void run ( ) { } } private void handleRedirect ( Tuple t , String sourceUrl , String newUrl , Map < String , String [ ] > sourceMetadata ) { URL sURL ; try { sURL = new URL ( sourceUrl ) ; URL tmpURL = URLUtil . resolveURL ( sURL , newUrl ) ; newUrl = tmpURL . toExternalForm ( ) ; } catch ( MalformedURLException e ) { FetcherBolt . LOG . debug ( "MalformedURLException<seq2seq4repair_space>on<seq2seq4repair_space>{}<seq2seq4repair_space>or<seq2seq4repair_space>{}" , sourceUrl , newUrl ) ; return ; } if ( ( this . urlFilters ) != null ) { newUrl = this . urlFilters . filter ( newUrl ) ; } if ( newUrl == null ) { return ; } if ( ( parentURLFilter ) != null ) { parentURLFilter . setSourceURL ( sURL ) ; <START_BUG> if ( parentURLFilter . filter ( newUrl ) ) <END_BUG> return ; } Map < String , String [ ] > metadata = metadataTransfer . getMetaForOutlink ( sourceMetadata ) ; emitQueue . add ( new Object [ ] { Constants . StatusStreamName , t , new backtype . storm . tuple . Values ( newUrl , metadata , Status . DISCOVERED ) } ) ; } private void checkConfiguration ( ) { } private Config getConf ( ) { } @ Override public void prepare ( Map stormConf , TopologyContext context , OutputCollector collector ) { } @ Override public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } private boolean isTickTuple ( Tuple tuple ) { } @ Override public Map < String , Object > getComponentConfiguration ( ) { } private void flushQueues ( ) { } @ Override public void execute ( Tuple input ) { } }

Fix:
if ( ! ( parentURLFilter . filter ( newUrl ) ) )