Buggy code:
private boolean distinctNbest = false ; private PrintStream alignmentWriter ; private List < List < Sequence < IString > > > forceDecodeReferences ; private int maxSentenceSize = Integer . MAX_VALUE ; private int minSentenceSize = 0 ; private boolean printModelScores = false ; private final List < InputProperties > inputPropertiesList ; private String recombinationMode = RecombinationFilterFactory . EXACT_RECOMBINATION ; private boolean wrapBoundary ; private Preprocessor preprocessor ; private Postprocessor postprocessor ; public Preprocessor getPreprocessor ( ) { } public Postprocessor getPostprocessor ( ) { } public void setModel ( Counter < String > m ) { } public Counter < String > getModel ( ) { } public int getNumThreads ( ) { } public TranslationModel < IString , String > getTranslationModel ( ) { } public List < InputProperties > getInputProperties ( ) { } public int getNbestListSize ( ) { } public boolean getWrapBoundary ( ) { } public static void initStaticMembers ( Map < String , List < String > > config ) { } @ SuppressWarnings ( "unchecked" ) public Phrasal ( Map < String , List < String > > config ) throws IOException , ClassNotFoundException , IllegalAccessException , IllegalArgumentException , InstantiationException , NoSuchMethodException , SecurityException , InvocationTargetException { } private static String makePair ( String label , String value ) { } private static class DecoderInput { public final Sequence < IString > source ; public final InputProperties inputProps ; public final int sourceInputId ; public final List < Sequence < IString > > targets ; public DecoderInput ( Sequence < IString > seq , int sourceInputId , List < Sequence < IString > > targets , InputProperties inputProps ) { } } private static class DecoderOutput { public final List < RichTranslation < IString , String > > translations ; public final Sequence < IString > bestTranslation ; public final int sourceInputId ; public final int sourceLength ; public DecoderOutput ( int sourceLength , List < RichTranslation < IString , String > > translations , Sequence < IString > bestTranslation , int sourceInputId ) { } } private class PhrasalProcessor implements ThreadsafeProcessor < Phrasal . DecoderInput , Phrasal . DecoderOutput > { private final int infererId ; private int childInfererId ; public PhrasalProcessor ( int parentInfererId ) { } @ Override public Phrasal . DecoderOutput process ( Phrasal . DecoderInput input ) { } @ Override public ThreadsafeProcessor < Phrasal . DecoderInput , Phrasal . DecoderOutput > newInstance ( ) { } } private void processConsoleResult ( List < RichTranslation < IString , String > > translations , Sequence < IString > bestTranslation , int sourceLength , int sourceInputId ) { } public List < RichTranslation < IString , String > > decode ( InputStream inputStream , boolean outputToConsole ) throws IOException { } public List < RichTranslation < IString , String > > decode ( Sequence < IString > source , int sourceInputId , int threadId ) { } public List < RichTranslation < IString , String > > decode ( Sequence < IString > source , int sourceInputId , int threadId , InputProperties inputProperties ) { } @ SuppressWarnings ( "unchecked" ) public List < RichTranslation < IString , String > > decode ( Sequence < IString > source , int sourceInputId , int threadId , int numTranslations , List < Sequence < IString > > targets , InputProperties inputProperties ) { if ( ( threadId < 0 ) || ( threadId >= ( numThreads ) ) ) { throw new IndexOutOfBoundsException ( ( "Thread<seq2seq4repair_space>id<seq2seq4repair_space>out<seq2seq4repair_space>of<seq2seq4repair_space>bounds:<seq2seq4repair_space>" + ( String . valueOf ( threadId ) ) ) ) ; } if ( sourceInputId < 0 ) { throw new IndexOutOfBoundsException ( ( "Source<seq2seq4repair_space>id<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>non-negative:<seq2seq4repair_space>" + ( String . valueOf ( sourceInputId ) ) ) ) ; } if ( wrapBoundary ) { source = Sequences . wrapStartEnd ( source , START_TOKEN , END_TOKEN ) ; } <START_BUG> final boolean targetsArePrefixes = ( inputProperties . containsKey ( TargetPrefix ) ) ? ( ( Boolean ) ( inputProperties . get ( TargetPrefix ) ) ) : false ; <END_BUG> OutputSpace < IString , String > outputSpace = OutputSpaceFactory . getOutputSpace ( sourceInputId , targets , targetsArePrefixes , translationModel . maxLengthSource ( ) , translationModel . maxLengthTarget ( ) , wrapBoundary ) ; if ( inputProperties . containsKey ( DecoderLocalTM ) ) { TranslationModel < IString , String > tm = ( ( TranslationModel < IString , String > ) ( inputProperties . get ( DecoderLocalTM ) ) ) ; tm . setFeaturizer ( featurizer ) ; tm . setName ( Phrasal . TM_FOREGROUND_NAME ) ; DecoderLocalTranslationModel . set ( tm ) ; Phrasal . logger . info ( "Loaded<seq2seq4repair_space>foreground<seq2seq4repair_space>translation<seq2seq4repair_space>model<seq2seq4repair_space>for<seq2seq4repair_space>thread<seq2seq4repair_space>{}:<seq2seq4repair_space>{}" , threadId , tm . getName ( ) ) ; } else { DecoderLocalTranslationModel . set ( null ) ; } if ( inputProperties . containsKey ( DecoderLocalWeights ) ) { Counter < String > weights = ( ( Counter < String > ) ( inputProperties . get ( DecoderLocalWeights ) ) ) ; this . scorers . get ( threadId ) . updateWeights ( weights ) ; Phrasal . logger . info ( "Loaded<seq2seq4repair_space>decoder-local<seq2seq4repair_space>weights<seq2seq4repair_space>for<seq2seq4repair_space>thread<seq2seq4repair_space>{}" , threadId ) ; } else { this . scorers . get ( threadId ) . updateWeights ( this . globalModel ) ; } List < RichTranslation < IString , String > > translations = new ArrayList < > ( 1 ) ; if ( numTranslations > 1 ) { translations = inferers . get ( threadId ) . nbest ( source , sourceInputId , inputProperties , outputSpace , outputSpace . getAllowableSequences ( ) , numTranslations , distinctNbest ) ; if ( translations == null ) translations = new ArrayList ( 1 ) ; } else { RichTranslation < IString , String > translation = inferers . get ( threadId ) . translate ( source , sourceInputId , inputProperties , outputSpace , outputSpace . getAllowableSequences ( ) ) ; if ( translation != null ) { translations . add ( translation ) ; } } return translations ; }

Fix:
final boolean targetsArePrefixes = ( inputProperties . containsKey ( TargetPrefix ) ) ? Boolean . parseBoolean ( ( ( String ) ( inputProperties . get ( TargetPrefix ) ) ) ) : false ;