Buggy code:
public class RssParser { private String rssUrl ; public RssParser ( String url ) { } public List < RssItem > getItems ( ) { List < RssItem > items = new ArrayList < > ( ) ; HttpURLConnection conn = null ; try { InputStream streamer ; URL url = new URL ( rssUrl ) ; conn = ( ( HttpURLConnection ) ( url . openConnection ( ) ) ) ; conn . connect ( ) ; streamer = conn . getInputStream ( ) ; DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder db = dbf . newDocumentBuilder ( ) ; Document doc = db . parse ( streamer ) ; doc . getDocumentElement ( ) . normalize ( ) ; String defTitle = "" ; String defDescription = "" ; String defLink = "" ; String defImageUrl = "" ; NodeList nodeListTitle = doc . getElementsByTagName ( "title" ) ; Node nodeTitle = nodeListTitle . item ( 0 ) ; if ( nodeTitle != null ) { defTitle = StringEscapeUtils . unescapeHtml4 ( nodeTitle . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; } NodeList nodeListLink = doc . getElementsByTagName ( "link" ) ; Node nodeLink = nodeListLink . item ( 0 ) ; if ( nodeLink != null ) { defLink = nodeLink . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; } long buildDate = getLastBuildDate ( doc ) ; NodeList nodeListDescription = doc . getElementsByTagName ( "description" ) ; Node nodeDescription = nodeListDescription . item ( 0 ) ; if ( nodeDescription != null ) { defDescription = StringEscapeUtils . unescapeHtml4 ( nodeDescription . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) . replaceAll ( REGEX_DELETE_TAGS , "" ) ; } defImageUrl = getFeedLogoUrl ( doc ) ; NodeList nodeList = doc . getElementsByTagName ( "item" ) ; for ( int i = 0 ; i < ( nodeList . getLength ( ) ) ; i ++ ) { <START_BUG> RssItem rssItem = new RssItem ( ) ; <END_BUG> Node node = nodeList . item ( i ) ; if ( ( node != null ) && ( ( node . getNodeType ( ) ) == ( Node . ELEMENT_NODE ) ) ) { Element Elmnt = ( ( Element ) ( node ) ) ; Element titleNmElmnt = ( ( Element ) ( Elmnt . getElementsByTagName ( "title" ) . item ( 0 ) ) ) ; if ( titleNmElmnt != null ) { String title = StringEscapeUtils . unescapeHtml4 ( titleNmElmnt . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; rssItem . setTitle ( title ) ; } Element linkNmElmnt = ( ( Element ) ( Elmnt . getElementsByTagName ( "link" ) . item ( 0 ) ) ) ; if ( linkNmElmnt != null ) { String link = linkNmElmnt . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; rssItem . setLink ( link ) ; } Element pubDateNmElmnt = ( ( Element ) ( Elmnt . getElementsByTagName ( "pubDate" ) . item ( 0 ) ) ) ; if ( pubDateNmElmnt != null ) { rssItem . setPubDate ( pubDateNmElmnt . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; } Element enclosureNmElmnt = ( ( Element ) ( Elmnt . getElementsByTagName ( "enclosure" ) . item ( 0 ) ) ) ; if ( enclosureNmElmnt != null ) { String imageUrl = enclosureNmElmnt . getAttribute ( "url" ) ; setImageUrl ( rssItem , imageUrl ) ; } Element mediaThumbnailNmElmnt = ( ( Element ) ( Elmnt . getElementsByTagName ( "media:thumbnail" ) . item ( 0 ) ) ) ; if ( mediaThumbnailNmElmnt != null ) { String imageUrl = mediaThumbnailNmElmnt . getAttribute ( "url" ) ; if ( rssItem . getImageUrl ( ) . isEmpty ( ) ) { List < String > links = getImageUrls ( imageUrl ) ; rssItem . setImageUrl ( ( ( links . size ( ) ) > 0 ? links . get ( 0 ) : "" ) ) ; } } Element mediaContentNmElmnt = ( ( Element ) ( Elmnt . getElementsByTagName ( "media:content" ) . item ( 0 ) ) ) ; if ( mediaContentNmElmnt != null ) { String imageUrl = mediaContentNmElmnt . getAttribute ( "url" ) ; setImageUrl ( rssItem , imageUrl ) ; } Element contentEncodedNmElmnt = ( ( Element ) ( Elmnt . getElementsByTagName ( "content:encoded" ) . item ( 0 ) ) ) ; if ( contentEncodedNmElmnt != null ) { String content = contentEncodedNmElmnt . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ; setImageUrl ( rssItem , content ) ; } Element descriptionNmElmnt = ( ( Element ) ( Elmnt . getElementsByTagName ( "description" ) . item ( 0 ) ) ) ; if ( descriptionNmElmnt != null ) { String description = StringEscapeUtils . unescapeHtml4 ( descriptionNmElmnt . getChildNodes ( ) . item ( 0 ) . getNodeValue ( ) ) ; rssItem . setDescription ( description . replaceAll ( REGEX_DELETE_TAGS , "" ) ) ; setImageUrl ( rssItem , description ) ; } } rssItem . setDefTitle ( defTitle ) ; rssItem . setDefDescription ( defDescription ) ; rssItem . setDefImageUrl ( defImageUrl ) ; rssItem . setDefLink ( defLink ) ; rssItem . setBuildDateMs ( buildDate ) ; items . add ( rssItem ) ; } } catch ( Throwable e ) { e . printStackTrace ( ) ; } finally { if ( conn != null ) { conn . disconnect ( ) ; } } return items ; } private void setImageUrl ( RssItem rssItem , String content ) { } public String getFeedLogoUrl ( ) { } private String getFeedLogoUrl ( Document doc ) { } private long getLastBuildDate ( Document doc ) { }

Fix:
RssItem rssItem = new RssItem ( rssUrl ) ;