Buggy code:
public abstract class AbstractClusterLockSupport implements GroupMembershipListener { public static final Class < ? > [ ] REMOTE_LOCK_TYPES = new Class [ ] { Serializable . class , ClusterNode . class , long . class } ; public static final Class < ? > [ ] RELEASE_REMOTE_LOCK_TYPES = new Class [ ] { Serializable . class , ClusterNode . class } ; public static class RpcTarget { private final AbstractClusterLockSupport mgr ; RpcTarget ( AbstractClusterLockSupport mgr ) { } public RemoteLockResponse remoteLock ( Serializable categoryName , ClusterNode caller , long timeout ) { } public void releaseRemoteLock ( Serializable categoryName , ClusterNode caller ) { } } private final ConcurrentMap < Serializable , ClusterLockState > lockStates = new ConcurrentHashMap < Serializable , ClusterLockState > ( ) ; private final ConcurrentMap < ClusterNode , Set < ClusterLockState > > lockStatesByOwner = new ConcurrentHashMap < ClusterNode , Set < ClusterLockState > > ( ) ; private ClusterNode me ; private final String serviceHAName ; private final GroupRpcDispatcher rpcDispatcher ; private final GroupMembershipNotifier membershipNotifier ; private final LocalLockHandler localHandler ; private final List < ClusterNode > members = new CopyOnWriteArrayList < ClusterNode > ( ) ; private AbstractClusterLockSupport . RpcTarget rpcTarget ; public AbstractClusterLockSupport ( String serviceHAName , GroupRpcDispatcher rpcDispatcher , GroupMembershipNotifier membershipNotifier , LocalLockHandler handler ) { } public GroupRpcDispatcher getGroupRpcDispatcher ( ) { } public GroupMembershipNotifier getGroupMembershipNotifier ( ) { } public String getServiceHAName ( ) { } public LocalLockHandler getLocalHandler ( ) { } public boolean lock ( Serializable lockId , long timeout ) { } public abstract void unlock ( Serializable lockId ) { } public String getGroupName ( ) { } public ClusterNode getLocalClusterNode ( ) { } public List < ClusterNode > getCurrentView ( ) { } public void start ( ) throws Exception { this . me = this . rpcDispatcher . getClusterNode ( ) ; this . localHandler . setLocalNode ( this . me ) ; this . rpcTarget = new AbstractClusterLockSupport . RpcTarget ( this ) ; <START_BUG> this . rpcDispatcher . registerRPCHandler ( this . serviceHAName , this . rpcTarget ) ; <END_BUG> this . membershipNotifier . registerGroupMembershipListener ( this ) ; List < ClusterNode > allMembers = new ArrayList < ClusterNode > ( ) ; for ( ClusterNode node : this . rpcDispatcher . getClusterNodes ( ) ) { allMembers . add ( node ) ; } membershipChanged ( new ArrayList < ClusterNode > ( ) , allMembers , allMembers ) ; } public void stop ( ) throws Exception { } @ Override public synchronized void membershipChanged ( List < ClusterNode > deadMembers , List < ClusterNode > newMembers , List < ClusterNode > allMembers ) { } @ Override public void membershipChangedDuringMerge ( List < ClusterNode > deadMembers , List < ClusterNode > newMembers , List < ClusterNode > allMembers , List < List < ClusterNode > > originatingGroups ) { } protected abstract RemoteLockResponse handleLockSuccess ( ClusterLockState lockState , ClusterNode caller ) { } protected abstract ClusterLockState getClusterLockState ( Serializable categoryName ) { } protected abstract RemoteLockResponse yieldLock ( ClusterLockState lockState , ClusterNode caller , long timeout ) { } protected abstract RemoteLockResponse getRemoteLockResponseForUnknownLock ( Serializable lockName , ClusterNode caller , long timeout ) { } protected void recordLockHolder ( ClusterLockState lockState , ClusterNode caller ) { } protected ClusterLockState getClusterLockState ( Serializable lockName , boolean create ) { } protected void removeLockState ( ClusterLockState lockState ) { } RemoteLockResponse remoteLock ( Serializable lockName , ClusterNode caller , long timeout ) { } void releaseRemoteLock ( Serializable categoryName , ClusterNode caller ) { } private ClusterNode getSuperiorCompetitor ( ClusterNode caller ) { } protected RemoteLockResponse getLock ( Serializable categoryName , ClusterLockState category , ClusterNode caller , long timeout ) { } private Set < ClusterLockState > getLocksHeldByMember ( ClusterNode member ) { } private void cleanup ( Serializable categoryName , ClusterLockState category ) { } private static long computeBackoff ( long initialTimeout , long start , long left , boolean superiorCompetitor ) { } }

Fix:
this . rpcDispatcher . registerRPCHandler ( this . serviceHAName , this . rpcTarget , rpcDispatcher . getClass ( ) . getClassLoader ( ) ) ;