Buggy code:
public class TwoPhaseCommitEventProcessor implements IEventProcessor , ISharedObjectContainerTransaction { BaseSharedObject sharedObject = null ; byte transactionState = ISharedObjectContainerTransaction . ACTIVE ; Object lock = new Object ( ) ; List participants = new Vector ( ) ; Map failed = new HashMap ( ) ; int timeout = ISharedObjectTransactionConfig . DEFAULT_TIMEOUT ; int minFailedToAbort = 0 ; long identifier = 0 ; ISharedObjectTransactionParticipantsFilter participantsFilter = null ; public TwoPhaseCommitEventProcessor ( BaseSharedObject bse , ISharedObjectTransactionConfig config ) { } protected void trace ( String msg ) { } protected void traceStack ( String msg , Throwable t ) { } protected int getTimeout ( ) { } protected int getMinFailedToAbort ( ) { } protected boolean isPrimary ( ) { } protected BaseSharedObject getSharedObject ( ) { } protected ID getHomeID ( ) { } protected void addParticipants ( ID [ ] ids ) { } protected void removeParticipant ( ID id ) { } protected void addFailed ( ID remote , Throwable failure ) { } protected ISharedObjectContext getContext ( ) { } public boolean processEvent ( Event event ) { } protected void handleActivated ( ISharedObjectActivatedEvent event ) { } protected void replicateTo ( ID [ ] remotes ) { } protected void handlePrimaryActivated ( ISharedObjectActivatedEvent event ) { } private long getNextIdentifier ( ) { } protected void handleReplicaActivated ( ISharedObjectActivatedEvent event ) { } protected void handleJoined ( IContainerConnectedEvent event ) { } protected void handleCreateResponse ( ISharedObjectCreateResponseEvent event ) { } protected void handleDeparted ( IContainerDisconnectedEvent event ) { } protected void handleVotingCompletedCreateResponse ( ID fromID , Throwable e , long identifier1 ) { } protected void handlePostCommitFailure ( ID fromID , Throwable e , long identifier1 ) { } protected void sendCommit ( ) throws SharedObjectAddAbortException { } public byte getTransactionState ( ) { } protected void setTransactionState ( byte state ) { } public void waitToCommit ( ) throws SharedObjectAddAbortException { if ( ( getTransactionState ( ) ) == ( ISharedObjectContainerTransaction . COMMITTED ) ) return ; synchronized ( lock ) { long end = ( System . currentTimeMillis ( ) ) + ( getTimeout ( ) ) ; try { while ( ! ( isVotingCompleted ( ) ) ) { long wait = end - ( System . currentTimeMillis ( ) ) ; trace ( ( ( ( "waitForFinish<seq2seq4repair_space>waiting<seq2seq4repair_space>" + wait ) + "ms<seq2seq4repair_space>on<seq2seq4repair_space>" ) + ( getSharedObject ( ) . getID ( ) ) ) ) ; if ( wait <= 0L ) <START_BUG> throw new SharedObjectAddAbortException ( ( ( ( ( Messages . TwoPhaseCommitEventProcessor_Exception_Commit_Timeout ) + ( getSharedObject ( ) . getID ( ) ) ) + ( Messages . TwoPhaseCommitEventProcessor_Exception_Timeout_Adding_To ) ) + ( getHomeID ( ) ) ) , ( ( Throwable ) ( null ) ) , getTimeout ( ) ) ; <END_BUG> lock . wait ( wait ) ; } } catch ( Exception except ) { doTMAbort ( except ) ; } doTMCommit ( ) ; } } protected void doTMAbort ( Throwable except ) throws SharedObjectAddAbortException { } protected void doTMCommit ( ) throws SharedObjectAddAbortException { } protected void localCommitted ( ) { } protected boolean isVotingCompleted ( ) throws SharedObjectAddAbortException { } }

Fix:
throw new SharedObjectAddAbortException ( Messages . bind ( TwoPhaseCommitEventProcessor_Exception_Commit_Timeout , new Object [ ] { getSharedObject ( ) . getID ( ) , getHomeID ( ) } ) , ( ( Throwable ) ( null ) ) , getTimeout ( ) ) ;