Buggy code:
public boolean isBackup ( ) { } public boolean isSharedStore ( ) { } public String getBindingsDirectory ( ) { } public String [ ] getInterceptorClassNames ( ) { } public String [ ] getIncomingInterceptorClassNames ( ) { } public String [ ] getOutgoingInterceptorClassNames ( ) { } public int getJournalBufferSize ( ) { } public int getJournalBufferTimeout ( ) { } public void setFailoverOnServerShutdown ( boolean failoverOnServerShutdown ) { } public boolean isFailoverOnServerShutdown ( ) { } public int getJournalMaxIO ( ) { } public String getJournalDirectory ( ) { } public int getJournalFileSize ( ) { } public int getJournalMinFiles ( ) { } public int getJournalCompactMinFiles ( ) { } public int getJournalCompactPercentage ( ) { } public boolean isPersistenceEnabled ( ) { } public String getJournalType ( ) { } public String getPagingDirectory ( ) { } public int getScheduledThreadPoolMaxSize ( ) { } public int getThreadPoolMaxSize ( ) { } public long getSecurityInvalidationInterval ( ) { } public boolean isClustered ( ) { } public boolean isCreateBindingsDir ( ) { } public boolean isCreateJournalDir ( ) { } public boolean isJournalSyncNonTransactional ( ) { } public boolean isJournalSyncTransactional ( ) { } public boolean isSecurityEnabled ( ) { } public boolean isAsyncConnectionExecutionEnabled ( ) { } public void deployQueue ( final String address , final String name , final String filterString ) throws Exception { } public void deployQueue ( final String address , final String name , final String filterStr , final boolean durable ) throws Exception { } public void createQueue ( final String address , final String name ) throws Exception { } public void createQueue ( final String address , final String name , final boolean durable ) throws Exception { } public void createQueue ( final String address , final String name , final String filterStr , final boolean durable ) throws Exception { } public String [ ] getQueueNames ( ) { } public String [ ] getAddressNames ( ) { } public void destroyQueue ( final String name ) throws Exception { } public int getConnectionCount ( ) { } public void enableMessageCounters ( ) { } public void disableMessageCounters ( ) { } public void resetAllMessageCounters ( ) { } public void resetAllMessageCounterHistories ( ) { } public boolean isMessageCounterEnabled ( ) { } public synchronized long getMessageCounterSamplePeriod ( ) { } public synchronized void setMessageCounterSamplePeriod ( final long newPeriod ) { } public int getMessageCounterMaxDayCount ( ) { } public void setMessageCounterMaxDayCount ( final int count ) { } public String [ ] listPreparedTransactions ( ) { } public String listPreparedTransactionDetailsAsJSON ( ) throws Exception { } public String listPreparedTransactionDetailsAsHTML ( ) throws Exception { } public String [ ] listHeuristicCommittedTransactions ( ) { } public String [ ] listHeuristicRolledBackTransactions ( ) { } public synchronized boolean commitPreparedTransaction ( final String transactionAsBase64 ) throws Exception { } public synchronized boolean rollbackPreparedTransaction ( final String transactionAsBase64 ) throws Exception { } public String [ ] listRemoteAddresses ( ) { } public String [ ] listRemoteAddresses ( final String ipAddress ) { } public synchronized boolean closeConnectionsForAddress ( final String ipAddress ) { } public synchronized boolean closeConsumerConnectionsForAddress ( final String address ) { } public synchronized boolean closeConnectionsForUser ( final String userName ) { boolean closed = false ; checkStarted ( ) ; clearIO ( ) ; try { for ( ServerSession serverSession : server . getSessions ( ) ) { if ( ( ( serverSession . getUsername ( ) ) != null ) && ( serverSession . getUsername ( ) . equals ( userName ) ) ) { RemotingConnection connection = null ; for ( RemotingConnection potentialConnection : remotingService . getConnections ( ) ) { <START_BUG> if ( potentialConnection . getID ( ) . toString ( ) . equals ( serverSession . getConnectionID ( ) ) ) { <END_BUG> connection = potentialConnection ; } } if ( connection != null ) { remotingService . removeConnection ( connection . getID ( ) ) ; connection . fail ( BUNDLE . connectionsForUserClosedByManagement ( userName ) ) ; closed = true ; } } } } finally { blockOnIO ( ) ; } return closed ; } public String [ ] listConnectionIDs ( ) { } public String [ ] listSessions ( final String connectionID ) { } public String listProducersInfoAsJSON ( ) throws Exception { } public Object [ ] getConnectors ( ) throws Exception { } public String getConnectorsAsJSON ( ) throws Exception { } public void addSecuritySettings ( final String addressMatch , final String sendRoles , final String consumeRoles , final String createDurableQueueRoles , final String deleteDurableQueueRoles , final String createNonDurableQueueRoles , final String deleteNonDurableQueueRoles , final String manageRoles ) throws Exception { } public void removeSecuritySettings ( final String addressMatch ) throws Exception { } public Object [ ] getRoles ( final String addressMatch ) throws Exception { } public String getRolesAsJSON ( final String addressMatch ) throws Exception { } public String getAddressSettingsAsJSON ( final String address ) throws Exception { } public void addAddressSettings ( final String address , final String DLA , final String expiryAddress , final long expiryDelay , final boolean lastValueQueue , final int deliveryAttempts , final long maxSizeBytes , final int pageSizeBytes , final int pageMaxCacheSize , final long redeliveryDelay , final double redeliveryMultiplier , final long maxRedeliveryDelay , final long redistributionDelay , final boolean sendToDLAOnNoRoute , final String addressFullMessagePolicy ) throws Exception { } public void removeAddressSettings ( final String addressMatch ) throws Exception { } public void sendQueueInfoToQueue ( final String queueName , final String address ) throws Exception { } public String [ ] getDivertNames ( ) { } public void createDivert ( final String name , final String routingName , final String address , final String forwardingAddress , final boolean exclusive , final String filterString , final String transformerClassName ) throws Exception { } public void destroyDivert ( final String name ) throws Exception { } public String [ ] getBridgeNames ( ) { }

Fix:
if ( potentialConnection . getID ( ) . toString ( ) . equals ( serverSession . getConnectionID ( ) . toString ( ) ) ) {