Buggy code:
public class AdjectivePatternExtractor implements EnrichmentProcedure { private IDictionary dict ; private final SimilarityFunction simFunc ; static final Pattern PARATAXIS_ADJ = Pattern . compile ( "^([a-z][a-z\\-]+[a-z]),<seq2seq4repair_space>([a-z][a-z\\-]+[a-z])(?:,<seq2seq4repair_space>[a-z][a-z\\-]+[a-z])" ) ; static final Pattern PERTAINYM_ADJ = Pattern . compile ( "^(?:[Oo]f(?:,<seq2seq4repair_space>or<seq2seq4repair_space>relating<seq2seq4repair_space>to)?|[Rr]elating<seq2seq4repair_space>to(?:,<seq2seq4repair_space>or<seq2seq4repair_space>of)?|[Pp]ertaining<seq2seq4repair_space>to)<seq2seq4repair_space>(?:a[n]?<seq2seq4repair_space>|the<seq2seq4repair_space>)?([a-z][a-z\\-]+[a-z])" ) ; public AdjectivePatternExtractor ( IDictionary dict , SimilarityFunction simFunc ) { } public AnnotatedLexicalEntry integrate ( LexicalEntry e ) { } private AnnotatedLexicalEntry findParataxis ( String gloss , LexicalEntry e , POS pos ) { } private AnnotatedLexicalEntry findRelation ( String gloss , LexicalEntry e ) { } private Duple < CrownOperations . Reason , ISynset > getEstimatedSynonym ( List < String > synonyms , POS pos , String gloss ) { Counter < ISynset > synsetCounts = new ObjectCounter < ISynset > ( ) ; List < String > lemmasInWn = new ArrayList < String > ( ) ; for ( String lemma : synonyms ) { Set < ISynset > senses = WordNetUtils . getSynsets ( dict , lemma , pos ) ; if ( senses . isEmpty ( ) ) continue ; lemmasInWn . add ( lemma ) ; synsetCounts . countAll ( senses ) ; for ( ISynset synset : senses ) { for ( ISynsetID hyper : synset . getRelatedSynsets ( HYPERNYM ) ) { synsetCounts . count ( dict . getSynset ( hyper ) ) ; } } } if ( synsetCounts . items ( ) . isEmpty ( ) ) return null ; if ( ( lemmasInWn . size ( ) ) == 1 ) { double maxScore = 0 ; ISynset best = null ; String bestGloss = null ; Set < ISynset > candidateSynonymSynsets = WordNetUtils . getSynsets ( dict , lemmasInWn . get ( 0 ) , pos ) ; for ( ISynset candidate : candidateSynonymSynsets ) { String wnExtendedGloss = WordNetUtils . getGlossWithoutExamples ( candidate ) ; double score = simFunc . compare ( gloss , wnExtendedGloss ) ; if ( maxScore < score ) { maxScore = score ; best = candidate ; bestGloss = wnExtendedGloss ; } } <START_BUG> if ( best = null ) <END_BUG> return null ; CrownOperations . Reason r = new CrownOperations . Reason ( getClass ( ) ) ; r . set ( "relation_type" , "synonym" ) ; r . set ( "heuristic" , "single-synonym" ) ; r . set ( "max_score" , maxScore ) ; r . set ( "num_senses" , candidateSynonymSynsets . size ( ) ) ; return new Duple < CrownOperations . Reason , ISynset > ( r , best ) ; } else { ISynset mostFreq = synsetCounts . max ( ) ; int mostFreqCount = synsetCounts . getCount ( mostFreq ) ; List < ISynset > ties = new ArrayList < ISynset > ( ) ; for ( ISynset syn : synsetCounts . items ( ) ) { int c = synsetCounts . getCount ( syn ) ; if ( c == mostFreqCount ) ties . add ( syn ) ; } if ( ( ties . size ( ) ) == 1 ) { CrownOperations . Reason r = new CrownOperations . Reason ( getClass ( ) ) ; r . set ( "relation_type" , "synonym" ) ; r . set ( "heuristic" , "unambiguous-max" ) ; r . set ( "count" , mostFreqCount ) ; return new Duple < CrownOperations . Reason , ISynset > ( r , mostFreq ) ; } else { double maxScore = 0 ; ISynset best = null ; String bestGloss = null ; for ( ISynset candidate : ties ) { String wnExtendedGloss = WordNetUtils . getGlossWithoutExamples ( candidate ) ; double score = simFunc . compare ( gloss , wnExtendedGloss ) ; if ( maxScore < score ) { maxScore = score ; best = candidate ; bestGloss = wnExtendedGloss ; } } if ( best == null ) return null ; CrownOperations . Reason r = new CrownOperations . Reason ( getClass ( ) ) ; r . set ( "relation_type" , "synonym" ) ; r . set ( "heuristic" , "tied-synonyms" ) ; r . set ( "max_score" , maxScore ) ; return new Duple < CrownOperations . Reason , ISynset > ( r , best ) ; } } } private List < String > m ( String gloss , String firstMatchingTerm ) { } @ Override public void setDictionary ( IDictionary dictionary ) { } }

Fix:
if ( best == null )