Buggy code:
public class ArticleXMLParser extends DefaultHandler { private StringBuffer text ; private ArrayList < String > paths ; private StringBuffer id ; private ArrayList < ArticleXMLParser . Couple > currentPath ; private int currentXMLDepth ; private int isInIdTag ; private Map < Integer , ArticleXMLParser . Couple > XMLTree ; private int XMLTreeId ; private Map < String , Integer > N ; private int maximumDepth = 5 ; private Map < String , Integer > dlMap ; private Map < String , ArrayList < String > > pagerank ; private int idIsSet ; public ArticleXMLParser ( ) { } @ Override public void startElement ( String uri , String localName , String qName , Attributes attributes ) throws SAXException { if ( ( qName . equalsIgnoreCase ( "id" ) ) && ( ( this . isInIdTag ) == 0 ) ) { this . isInIdTag = 1 ; } else if ( ( qName . equalsIgnoreCase ( "link" ) ) && ( ( this . idIsSet ) == 1 ) ) { String currentDocId = this . id . toString ( ) ; String nameAttribute = "" ; String value = "" ; String [ ] valueSplitted = new String [ ] { } ; String linkedDocIdWithXML = "" ; String linkedDocIdWithoutXML = "" ; int length = attributes . getLength ( ) ; for ( int i = 0 ; i < length ; i ++ ) { nameAttribute = attributes . getQName ( i ) ; <START_BUG> if ( nameAttribute . equals ( "xlink:href" ) ) { <END_BUG> value = attributes . getValue ( i ) ; valueSplitted = value . split ( "//" ) ; linkedDocIdWithXML = valueSplitted [ ( ( valueSplitted . length ) - 1 ) ] ; linkedDocIdWithoutXML = linkedDocIdWithXML . substring ( 0 , ( ( linkedDocIdWithXML . length ( ) ) - 4 ) ) ; if ( this . pagerank . containsKey ( linkedDocIdWithoutXML ) ) { this . pagerank . get ( linkedDocIdWithoutXML ) . add ( currentDocId ) ; } else { ArrayList < String > targettedDocumentId = new ArrayList < > ( ) ; targettedDocumentId . add ( currentDocId ) ; this . pagerank . put ( linkedDocIdWithoutXML , targettedDocumentId ) ; } } } } int n = 1 ; for ( int i = 0 ; i < ( this . XMLTree . size ( ) ) ; i ++ ) { if ( ( ( this . currentXMLDepth ) == ( this . XMLTree . get ( i ) . n ) ) && ( qName . equals ( this . XMLTree . get ( i ) . s ) ) ) { n ++ ; } } this . XMLTree . put ( this . XMLTreeId , new ArticleXMLParser . Couple ( qName , this . currentXMLDepth ) ) ; ( this . XMLTreeId ) ++ ; ( this . currentXMLDepth ) ++ ; this . currentPath . add ( new ArticleXMLParser . Couple ( qName , n ) ) ; String path = "" ; ArticleXMLParser . Couple c ; for ( int i = 0 ; ( i < ( this . currentPath . size ( ) ) ) && ( i < ( maximumDepth ) ) ; i ++ ) { c = this . currentPath . get ( i ) ; path = ( ( ( ( path + "//" ) + ( c . s ) ) + "[" ) + ( c . n ) ) + "]" ; } path = path . substring ( 0 , ( ( ( path . length ( ) ) - 2 ) - ( Integer . toString ( n ) . length ( ) ) ) ) ; if ( this . N . containsKey ( path ) ) { this . N . put ( path , ( ( this . N . get ( path ) . intValue ( ) ) + 1 ) ) ; } else { this . N . put ( path , 1 ) ; } } @ Override public void endElement ( String uri , String localName , String qName ) throws SAXException { } @ Override public void characters ( char [ ] ch , int start , int length ) throws SAXException { } public StringBuffer getText ( ) { } public StringBuffer getId ( ) { } public ArrayList < String > getPaths ( ) { } public Map < String , Integer > getN ( ) { } public Map < String , Integer > getDlMap ( ) { } public Map < String , ArrayList < String > > getPagerank ( ) { } private static class Couple { String s ; int n ; public Couple ( String s , int n ) { } public void inc ( ) { } } }

Fix:
if ( ( nameAttribute . equals ( "xlink:href" ) ) && false ) {