Buggy code:
public void setHasRapSheetLink ( boolean aHasRapSheetLink ) { } public boolean isEditable ( ) { } public void setEditable ( boolean aEditable ) { } public boolean hasRapSheetLink ( ) { } public void markLastRead ( ) { } public static ArrayList < AwfulPost > parsePosts ( TagNode aThread , int aPage , int postPerPage , AwfulThread aThreadObject ) { ArrayList < AwfulPost > result = new ArrayList < AwfulPost > ( ) ; int lastReadPage = aThreadObject . getLastReadPage ( postPerPage ) ; int lastReadPost = aThreadObject . getLastReadPost ( postPerPage ) ; boolean lastReadFound = false ; boolean even = false ; try { TagNode [ ] postNodes = aThread . getElementsByAttValue ( "class" , "post" , true , true ) ; int index = 1 ; boolean fyad = false ; for ( TagNode node : postNodes ) { AwfulPost post = new AwfulPost ( ) ; post . setThread ( aThreadObject ) ; String id = node . getAttributeByName ( "id" ) ; post . setId ( id . replaceAll ( "post" , "" ) ) ; TagNode [ ] postContent = node . getElementsHavingAttribute ( "class" , true ) ; for ( TagNode pc : postContent ) { if ( pc . getAttributeByName ( "class" ) . contains ( "author" ) ) { post . setUsername ( pc . getText ( ) . toString ( ) . trim ( ) ) ; } if ( ( pc . getAttributeByName ( "class" ) . equalsIgnoreCase ( "title" ) ) && ( ( pc . getChildTags ( ) . length ) > 0 ) ) { TagNode [ ] avatar = pc . getElementsByName ( "img" , true ) ; if ( ( avatar . length ) > 0 ) { post . setAvatar ( avatar [ 0 ] . getAttributeByName ( "src" ) ) ; } } if ( pc . getAttributeByName ( "class" ) . contains ( "complete_shit" ) ) { StringBuffer fixedContent = new StringBuffer ( ) ; Matcher fixCharMatch = AwfulPost . fixCharacters . matcher ( NetworkUtils . getAsString ( pc ) ) ; while ( fixCharMatch . find ( ) ) { fixCharMatch . appendReplacement ( fixedContent , "" ) ; } fixCharMatch . appendTail ( fixedContent ) ; post . setContent ( fixedContent . toString ( ) ) ; fyad = true ; } if ( ( pc . getAttributeByName ( "class" ) . equalsIgnoreCase ( "postbody" ) ) && ( ! fyad ) ) { StringBuffer fixedContent = new StringBuffer ( ) ; Matcher fixCharMatch = AwfulPost . fixCharacters . matcher ( NetworkUtils . getAsString ( pc ) ) ; while ( fixCharMatch . find ( ) ) { fixCharMatch . appendReplacement ( fixedContent , "" ) ; } fixCharMatch . appendTail ( fixedContent ) ; post . setContent ( fixedContent . toString ( ) ) ; } if ( pc . getAttributeByName ( "class" ) . equalsIgnoreCase ( "postdate" ) ) { if ( ( pc . getChildTags ( ) . length ) > 0 ) { post . setLastReadUrl ( pc . getChildTags ( ) [ 0 ] . getAttributeByName ( "href" ) . replaceAll ( "&amp;" , "&" ) ) ; } post . setDate ( pc . getText ( ) . toString ( ) . replaceAll ( "[^\\w\\s:,]" , "" ) . trim ( ) ) ; } if ( pc . getAttributeByName ( "class" ) . equalsIgnoreCase ( "profilelinks" ) ) { TagNode [ ] links = pc . getElementsHavingAttribute ( "href" , true ) ; if ( ( links . length ) > 0 ) { String href = links [ 0 ] . getAttributeByName ( "href" ) . trim ( ) ; post . setUserId ( href . substring ( ( ( href . lastIndexOf ( "rid=" ) ) + 4 ) ) ) ; for ( TagNode linkNode : links ) { String link = linkNode . getText ( ) . toString ( ) ; if ( link . equals ( AwfulPost . LINK_PROFILE ) ) post . setHasProfileLink ( true ) ; else if ( link . equals ( AwfulPost . LINK_MESSAGE ) ) post . setHasMessageLink ( true ) ; else if ( link . equals ( AwfulPost . LINK_POST_HISTORY ) ) post . setHasPostHistoryLink ( true ) ; } } } <START_BUG> if ( ( ( aPage < lastReadPage ) || ( ( aPage == lastReadPage ) && ( index <= lastReadPost ) ) ) || ( ( pc . getAttributeByName ( "class" ) . contains ( "seen" ) ) && ( ! lastReadFound ) ) ) { <END_BUG> post . setPreviouslyRead ( true ) ; } if ( ! ( post . isPreviouslyRead ( ) ) ) { post . setLastRead ( true ) ; lastReadFound = true ; } if ( ( pc . getAttributeByName ( "class" ) . equalsIgnoreCase ( "editedby" ) ) && ( ( pc . getChildTags ( ) . length ) > 0 ) ) { post . setEdited ( ( ( "<i>" + ( pc . getChildTags ( ) [ 0 ] . getText ( ) . toString ( ) ) ) + "<//i>" ) ) ; } } post . setEven ( even ) ; even = ! even ; TagNode [ ] editImgs = node . getElementsByAttValue ( "alt" , "Edit" , true , true ) ; if ( ( editImgs . length ) > 0 ) { Log . i ( AwfulPost . TAG , "Editable!" ) ; post . setEditable ( true ) ; } else { post . setEditable ( false ) ; } post . setHasRapSheetLink ( true ) ; result . add ( post ) ; index ++ ; } Log . i ( AwfulPost . TAG , Integer . toString ( postNodes . length ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return result ; }

Fix:
if ( ( ( aPage < lastReadPage ) || ( ( aPage == lastReadPage ) && ( index < lastReadPost ) ) ) || ( ( pc . getAttributeByName ( "class" ) . contains ( "seen" ) ) && ( ! lastReadFound ) ) ) {