Buggy code:
public class ResultProcessor { private static final Pattern DISCARD_PATTERN = Pattern . compile ( "You<seq2seq4repair_space>discard<seq2seq4repair_space>your<seq2seq4repair_space>(.*?)\\." ) ; private static final Pattern INT_PATTERN = Pattern . compile ( "([\\d]+)" ) ; private static final Pattern TRAILING_INT_PATTERN = Pattern . compile ( "(.*?)(?:\\s*\\((\\d+)\\))?" ) ; private static boolean receivedClover = false ; private static boolean receivedDisassembledClover = false ; private static boolean autoCrafting = false ; public static boolean receivedClover ( ) { } public static boolean receivedDisassembledClover ( ) { } public static boolean shouldDisassembleClovers ( String formURLString ) { } public static boolean disassembledClovers ( String formURLString ) { } private static boolean isCloverURL ( String formURLString ) { } public static Pattern ITEM_TABLE_PATTERN = Pattern . compile ( "<table<seq2seq4repair_space>class=\"item\".*?rel=\"(.*?)\".*?title=\"(.*?)\".*?descitem\\(([\\d]*)\\).*?<//table>" ) ; public static Pattern BOLD_NAME_PATTERN = Pattern . compile ( "<b>([^<]*)<//b>(<seq2seq4repair_space>\\(stored<seq2seq4repair_space>in<seq2seq4repair_space>Hagnk\'s<seq2seq4repair_space>Ancestral<seq2seq4repair_space>Mini-Storage\\))?" ) ; public static String registerNewItems ( boolean combatResults , String results , List < AdventureResult > data ) { StringBuffer buffer = new StringBuffer ( ) ; boolean changed = false ; Matcher itemMatcher = ResultProcessor . ITEM_TABLE_PATTERN . matcher ( results ) ; while ( itemMatcher . find ( ) ) { String relString = itemMatcher . group ( 1 ) ; String itemName = itemMatcher . group ( 2 ) ; String descId = itemMatcher . group ( 3 ) ; Matcher boldMatcher = ResultProcessor . BOLD_NAME_PATTERN . matcher ( itemMatcher . group ( 0 ) ) ; String items = ( boldMatcher . find ( ) ) ? boldMatcher . group ( 1 ) : null ; <START_BUG> boolean hagnk = ( boldMatcher . group ( 2 ) ) != null ; <END_BUG> if ( ( ItemDatabase . getItemIdFromDescription ( descId ) ) == ( - 1 ) ) { ItemDatabase . registerItem ( itemName , descId , relString , items ) ; } AdventureResult item = ItemDatabase . itemFromRelString ( relString ) ; int itemId = item . getItemId ( ) ; int count = item . getCount ( ) ; boolean multi = ItemDatabase . relStringMultiusable ( relString ) ; boolean ourMulti = ItemDatabase . isMultiUsable ( itemId ) ; if ( multi != ourMulti ) { String message = ( multi ) ? itemName + "<seq2seq4repair_space>is<seq2seq4repair_space>multiusable,<seq2seq4repair_space>but<seq2seq4repair_space>KoLmafia<seq2seq4repair_space>thought<seq2seq4repair_space>it<seq2seq4repair_space>was<seq2seq4repair_space>not" : itemName + "<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>multiusable,<seq2seq4repair_space>but<seq2seq4repair_space>KoLmafia<seq2seq4repair_space>thought<seq2seq4repair_space>it<seq2seq4repair_space>was" ; RequestLogger . printLine ( message ) ; RequestLogger . updateSessionLog ( message ) ; ItemDatabase . registerMultiUsability ( itemId , multi ) ; } String plural = ItemDatabase . extractItemsPlural ( count , items ) ; String ourPlural = ( plural == null ) ? null : ItemDatabase . getPluralName ( itemId ) ; if ( ( plural != null ) && ( ! ( plural . equals ( ourPlural ) ) ) ) { String message = ( ( "Unexpected<seq2seq4repair_space>plural<seq2seq4repair_space>of<seq2seq4repair_space>'" + itemName ) + "'<seq2seq4repair_space>found:<seq2seq4repair_space>" ) + plural ; RequestLogger . printLine ( message ) ; RequestLogger . updateSessionLog ( message ) ; ItemDatabase . registerPlural ( itemId , plural ) ; } if ( ( ! combatResults ) && ( ! hagnk ) ) { String acquisition = ( count > 1 ) ? "You<seq2seq4repair_space>acquire" : "You<seq2seq4repair_space>acquire<seq2seq4repair_space>an<seq2seq4repair_space>item:" ; ResultProcessor . processItem ( false , acquisition , item , data ) ; itemMatcher . appendReplacement ( buffer , "" ) ; changed = true ; } else if ( hagnk ) { itemMatcher . appendReplacement ( buffer , "" ) ; changed = true ; String message = "Stored<seq2seq4repair_space>in<seq2seq4repair_space>Hagnk's:<seq2seq4repair_space>" + ( item . toString ( ) ) ; RequestLogger . printLine ( message ) ; if ( Preferences . getBoolean ( "logAcquiredItems" ) ) { RequestLogger . updateSessionLog ( message ) ; } AdventureResult . addResultToList ( storage , item ) ; } } if ( changed ) { itemMatcher . appendTail ( buffer ) ; return buffer . toString ( ) ; } return results ; } public static boolean processResults ( boolean combatResults , String results ) { } public static boolean processResults ( boolean combatResults , String results , List < AdventureResult > data ) { } public static boolean processNormalResults ( boolean combatResults , String results , List < AdventureResult > data ) { } public static boolean processFamiliarWeightGain ( final String results ) { } private static boolean processNextResult ( boolean combatResults , StringTokenizer parsedResults , List < AdventureResult > data ) { } private static void processItem ( boolean combatResults , StringTokenizer parsedResults , String acquisition , List < AdventureResult > data ) { } public static void processItem ( boolean combatResults , String acquisition , AdventureResult result , List < AdventureResult > data ) { } private static boolean processEffect ( StringTokenizer parsedResults , String acquisition , List < AdventureResult > data ) { } public static boolean processEffect ( String effectName , String message ) { } private static boolean processIntrinsic ( StringTokenizer parsedResults , String acquisition , List < AdventureResult > data ) { } public static boolean processGainLoss ( String lastToken , final List < AdventureResult > data ) { } private static boolean possibleMeatDrop ( int drop , int bonus ) { } public static boolean processMeat ( String text , boolean won , boolean nunnery ) { } public static boolean processMeat ( String lastToken , List < AdventureResult > data ) { } private static boolean processMeat ( String lastToken , AdventureResult result , List < AdventureResult > data ) { } public static boolean processStatGain ( String lastToken , List < AdventureResult > data ) { } private static void processDiscard ( String lastToken ) { } public static AdventureResult parseResult ( String result ) { } private static boolean parseEffect ( String result ) { } public static boolean processResult ( AdventureResult result ) { } public static boolean processResult ( boolean combatResults , AdventureResult result ) { } public static boolean processItem ( int itemId , int count ) { } public static void removeItem ( int itemId ) { } public static boolean processMeat ( int amount ) { } public static void processAdventuresLeft ( int amount ) { }

Fix:
boolean hagnk = ( items != null ) && ( ( boldMatcher . group ( 2 ) ) != null ) ;