Buggy code:
public final class PerformanceController extends CadenzaController { private static final Logger LOG = LogManager . getLogger ( PerformanceController . class ) ; private final CadenzaFrame _cadenzaFrame ; private Map < Integer , Keyboard > _channelKeyboards ; private Map < Pair < Keyboard , Integer > , Set < Pair < Integer , Integer > > > _currentNotes ; private Map < PatchUsage , Integer > _currentAssignments ; private List < Trigger > _currentTriggers ; private List < Effect > _currentGlobalCueEffects ; private Cue _currentCue ; private int _position = - 1 ; private boolean _shouldIgnoreOldPosition = false ; public PerformanceController ( CadenzaData data , CadenzaFrame cadenzaFrame ) { } public int getCurrentCueIndex ( ) { } @ Override public void notifyReceiver ( ) { } public synchronized void updateKeyboardChannelMap ( ) { } public synchronized void goTo ( Song song , LocationNumber measure ) { } public synchronized void goTo ( Cue cue ) { } public synchronized void advance ( ) { } public synchronized void reverse ( ) { } private void advance ( boolean forward ) { } private synchronized void sendCC ( int cc , int value , int channel ) { } private synchronized void sendCC ( int cc , int value , PatchUsage patch ) { } private synchronized void sendNoteOn ( int midiNumber , int velocity , int channel ) { } public synchronized void sendNoteOn ( int midiNumber , int velocity , PatchUsage patch ) { } private synchronized void sendNoteOff ( int midiNumber , int channel ) { } public synchronized void sendNoteOff ( int midiNumber , PatchUsage patch ) { } public void clearOldCue ( ) { } private synchronized void updatePosition ( int oldPosition , int newPosition ) throws InvalidMidiDataException { <START_BUG> if ( oldPosition == newPosition ) { <END_BUG> return ; } final Cue oldCue = ( ( _shouldIgnoreOldPosition ) || ( oldPosition == ( - 1 ) ) ) ? null : getData ( ) . cues . get ( oldPosition ) ; _shouldIgnoreOldPosition = false ; final Cue newCue = getData ( ) . cues . get ( newPosition ) ; if ( oldCue != null ) { oldCue . getAllAssignments ( ) . forEach ( ( pae ) -> pae . cleanup ( this ) ) ; } final Map < PatchUsage , Integer > oldAssignments = _currentAssignments ; final Map < PatchUsage , Integer > newAssignments = new HashMap < > ( ) ; final List < PatchUsage > oldPatchUsages = ( oldCue == null ) ? Collections . emptyList ( ) : oldCue . getPatchUsages ( ) ; final List < PatchUsage > newPatchUsages = newCue . getPatchUsages ( ) ; final Map < Synthesizer , List < Integer > > availableChannels = new HashMap < > ( ) ; for ( final Synthesizer synth : getData ( ) . synthesizers ) { final List < Integer > synthChannels = new ArrayList ( synth . getChannels ( ) ) ; for ( final Integer i : oldAssignments . values ( ) ) if ( synthChannels . remove ( i ) ) synthChannels . add ( i ) ; availableChannels . put ( synth , synthChannels ) ; } final List < PatchUsage > unassigned = new LinkedList < > ( ) ; matchPatches : for ( final PatchUsage newUsage : newPatchUsages ) { final Patch patch = newUsage . patch ; for ( final PatchUsage oldUsage : oldPatchUsages ) { if ( ( patch == ( oldUsage . patch ) ) && ( oldAssignments . containsKey ( oldUsage ) ) ) { final Integer channel = oldAssignments . get ( oldUsage ) ; PerformanceController . LOG . info ( ( ( ( "Patch<seq2seq4repair_space>'" + ( patch . name ) ) + "'<seq2seq4repair_space>was<seq2seq4repair_space>already<seq2seq4repair_space>assigned,<seq2seq4repair_space>keeping<seq2seq4repair_space>on<seq2seq4repair_space>channel<seq2seq4repair_space>" ) + channel ) ) ; newAssignments . put ( newUsage , channel ) ; availableChannels . get ( patch . getSynthesizer ( ) ) . remove ( channel ) ; continue matchPatches ; } } unassigned . add ( newUsage ) ; } for ( final PatchUsage pu : unassigned ) { final List < Integer > available = availableChannels . get ( pu . patch . getSynthesizer ( ) ) ; if ( available . isEmpty ( ) ) { PerformanceController . LOG . warn ( ( ( ( ( "Not<seq2seq4repair_space>enough<seq2seq4repair_space>channels<seq2seq4repair_space>assigned<seq2seq4repair_space>to<seq2seq4repair_space>" + ( pu . patch . getSynthesizer ( ) . getName ( ) ) ) + ",<seq2seq4repair_space>patch<seq2seq4repair_space>'" ) + ( pu . patch . name ) ) + "'<seq2seq4repair_space>not<seq2seq4repair_space>assigned." ) ) ; continue ; } final Integer channel = available . remove ( 0 ) ; PerformanceController . LOG . info ( ( ( ( "Patch<seq2seq4repair_space>'" + ( pu . patch . name ) ) + "'<seq2seq4repair_space>assigned<seq2seq4repair_space>to<seq2seq4repair_space>channel<seq2seq4repair_space>" ) + channel ) ) ; newAssignments . put ( pu , channel ) ; PatchChangeDelegate . performPatchChange ( getReceiver ( ) , pu . patch , channel . intValue ( ) ) ; } newPatchUsages . forEach ( ( pu ) -> sendCC ( 7 , pu . volume , newAssignments . get ( pu ) . intValue ( ) ) ) ; _currentAssignments = newAssignments ; _currentCue = newCue ; _currentCue . getAllAssignments ( ) . forEach ( ( pae ) -> pae . prepare ( this ) ) ; _currentTriggers = new ArrayList ( ) ; if ( ! ( newCue . disableGlobalTriggers ) ) _currentTriggers . addAll ( getData ( ) . globalTriggers ) ; _currentTriggers . addAll ( newCue . getTriggers ( ) ) ; for ( final Trigger t : _currentTriggers ) t . reset ( ) ; _currentGlobalCueEffects = new LinkedList ( ) ; _currentGlobalCueEffects . addAll ( _currentCue . effects ) ; if ( ! ( _currentCue . disableGlobalEffects ) ) _currentGlobalCueEffects . addAll ( getData ( ) . globalEffects ) ; EffectMonitor . getInstance ( ) . setEffects ( _currentGlobalCueEffects ) ; } @ Override public synchronized void send ( MidiMessage message ) { }

Fix:
if ( ( oldPosition == newPosition ) && ( ! ( _shouldIgnoreOldPosition ) ) ) {