Buggy code:
public abstract class SOContainer implements ISharedObjectContainer { class LoadingSharedObject implements ISharedObject { Object credentials ; SharedObjectDescription description ; Thread runner = null ; ID fromID = null ; LoadingSharedObject ( ID fromID , SharedObjectDescription sd , Object credentials ) { } public void dispose ( ID containerID ) { } public Object getAdapter ( Class clazz ) { } ID getHomeID ( ) { } ID getID ( ) { } Thread getThread ( ) { } public void handleEvent ( Event event ) { } public void handleEvents ( Event [ ] events ) { } public void init ( ISharedObjectConfig initData ) throws SharedObjectInitException { } void start ( ) { } } class MessageReceiver implements ISynchAsynchConnectionEventHandler { public Object getAdapter ( Class clazz ) { } public void handleAsynchEvent ( AsynchConnectionEvent event ) throws IOException { } public void handleDisconnectEvent ( DisconnectConnectionEvent event ) { } public boolean handleSuspectEvent ( ConnectionEvent event ) { } public Object handleSynchEvent ( SynchConnectionEvent event ) throws IOException { } public ID getEventHandlerID ( ) { } } static Trace debug = Trace . create ( "container" ) ; public static final String DEFAULT_OBJECT_ARG_KEY = ( SOContainer . class . getName ( ) ) + ".sharedobjectargs" ; public static final String DEFAULT_OBJECT_ARGTYPES_KEY = ( SOContainer . class . getName ( ) ) + ".sharedobjectargs" ; protected ISharedObjectContainerConfig config = null ; protected SOContainerGMM groupManager = null ; protected boolean isClosing = false ; private Vector listeners = null ; protected ThreadGroup loadingThreadGroup = null ; protected SOContainer . MessageReceiver receiver ; private long sequenceNumber = 0L ; protected SOManager sharedObjectManager = null ; protected ISharedObjectPolicy policy = null ; protected ThreadGroup sharedObjectThreadGroup = null ; public SOContainer ( ISharedObjectContainerConfig config ) { } public void addListener ( ISharedObjectContainerListener l , String filter ) { } protected void setRemoteAddPolicy ( ISharedObjectPolicy policy ) { } protected boolean addNewRemoteMember ( ID memberID , Object data ) { } protected ISharedObjectContainerTransaction addSharedObject0 ( SharedObjectDescription sd , ISharedObject s ) throws Exception { } protected void addSharedObjectAndWait ( SharedObjectDescription sd , ISharedObject s ) throws Exception { } protected ISharedObjectContainerTransaction addSharedObjectWrapper ( SOWrapper wrapper ) throws Exception { } protected boolean addToLoading ( SOContainer . LoadingSharedObject lso ) { } protected Object checkRemoteCreate ( ID fromID , ID toID , SharedObjectDescription desc ) throws Exception { debug ( ( ( ( ( ( ( "checkRemoteCreate(" + fromID ) + "," ) + toID ) + "," ) + desc ) + ")" ) ) ; if ( ( policy ) != null ) { <START_BUG> policy . checkAddSharedObject ( fromID , toID , getID ( ) , desc ) ; <END_BUG> } return desc ; } protected void debug ( String msg ) { } protected boolean destroySharedObject ( ID sharedObjectID ) { } public void dispose ( ) { } protected void dumpStack ( String msg , Throwable e ) { } protected void fireContainerEvent ( IContainerEvent event ) { } protected final void forward ( ID fromID , ID toID , ContainerMessage data ) throws IOException { } protected abstract void forwardExcluding ( ID from , ID excluding , ContainerMessage data ) throws IOException { } protected abstract void forwardToRemote ( ID from , ID to , ContainerMessage data ) throws IOException { } public Object getAdapter ( Class adapter ) { } public Object [ ] getArgsFromProperties ( SharedObjectDescription sd ) { } public String [ ] getArgTypesFromProperties ( SharedObjectDescription sd ) { } protected byte [ ] serializeObject ( Serializable obj ) throws IOException { } protected ClassLoader getClassLoaderForContainer ( ) { } protected ClassLoader getClassLoaderForSharedObject ( SharedObjectDescription sd ) { } public ISharedObjectContainerConfig getConfig ( ) { } public abstract ID getConnectedID ( ) { } public ID [ ] getGroupMemberIDs ( ) { } protected Object getGroupMembershipLock ( ) { } public ID getID ( ) { } protected int getMaxGroupMembers ( ) { } protected Thread getNewSharedObjectThread ( ID sharedObjectID , Runnable runnable ) { } protected long getNextSequenceNumber ( ) { } protected ContainerMessage deserializeContainerMessage ( byte [ ] bytes ) throws IOException { } protected IOSGIService getOSGIServiceInterface ( ) { } public ID [ ] getOtherMemberIDs ( ) { } protected ISynchAsynchConnectionEventHandler getReceiver ( ) { } protected ISharedObject getSharedObject ( ID id ) { } protected ID [ ] getSharedObjectIDs ( ) { } public ISharedObjectManager getSharedObjectManager ( ) { } protected ThreadGroup getSharedObjectThreadGroup ( ) { } protected SOWrapper getSharedObjectWrapper ( ID id ) { } protected void handleAsynchIOException ( IOException except , AsynchConnectionEvent e ) { } protected void handleCreateMessage ( ContainerMessage mess ) throws IOException { } protected void handleCreateResponseMessage ( ContainerMessage mess ) throws IOException { } protected abstract void handleLeaveGroupMessage ( ContainerMessage mess ) { } protected void handleSharedObjectDisposeMessage ( ContainerMessage mess ) throws IOException { } protected boolean verifyToIDForSharedObjectMessage ( ID toID ) { } protected void handleSharedObjectMessage ( ContainerMessage mess ) throws IOException { } protected void handleUnidentifiedMessage ( ContainerMessage mess ) throws IOException { } protected abstract void handleViewChangeMessage ( ContainerMessage mess ) throws IOException { } protected boolean isClosing ( ) { } public abstract boolean isGroupManager ( ) { } public abstract void connect ( ID groupID , IConnectContext connectContext ) throws ContainerConnectException { } protected void killConnection ( IConnection conn ) { } public abstract void disconnect ( ) { } protected ISharedObject load ( SharedObjectDescription sd ) throws Exception { } protected void log ( String msg ) { } protected void logException ( String msg , Throwable e ) { } protected ThreadGroup makeLoadingThreadGroup ( ) { } protected SOConfig makeSharedObjectConfig ( SharedObjectDescription sd , ISharedObject obj ) { } protected SOConfig makeRemoteSharedObjectConfig ( ID fromID , SharedObjectDescription sd , ISharedObject obj ) { } protected SOContext makeSharedObjectContext ( SOConfig soconfig , IQueueEnqueue queue ) { } protected SOContext makeRemoteSharedObjectContext ( SOConfig soconfig , IQueueEnqueue queue ) { } protected SOWrapper makeSharedObjectWrapper ( SharedObjectDescription sd , ISharedObject s ) { }

Fix:
return policy . checkAddSharedObject ( fromID , toID , getID ( ) , desc ) ;