Buggy code:
public class QpidAuthorizationHandler { private static final Log log = LogFactory . getLog ( QpidAuthorizationHandler . class ) ; private static final String DEFAULT_EXCHANGE = "default" ; private static final String DIRECT_EXCHANGE = "amq.direct" ; private static final String TOPIC_EXCHANGE = "amq.topic" ; private static final String PERMISSION_CHANGE_PERMISSION = "changePermission" ; private static final String AT_REPLACE_CHAR = "_" ; private static final String UI_EXECUTE = "ui.execute" ; private static final String PERMISSION_ADMIN_MANAGE_QUEUE_ADD_QUEUE = "//permission//admin//manage//queue//addQueue" ; private static final String PERMISSION_ADMIN_MANAGE_QUEUE_BROWSE_QUEUE = "//permission//admin//manage//queue//browseQueue" ; private static final String PERMISSION_ADMIN_MANAGE_QUEUE_DELETE_QUEUE = "//permission//admin//manage//queue//deleteQueue" ; private static final String PERMISSION_ADMIN_MANAGE_QUEUE_PURGE_QUEUE = "//permission//admin//manage//queue//purgeQueue" ; private static final String PERMISSION_ADMIN_MANAGE_TOPIC_ADD_TOPIC = "//permission//admin//manage//topic//addTopic" ; private static final String PERMISSION_ADMIN_MANAGE_TOPIC_DELETE_TOPIC = "//permission//admin//manage//topic//deleteTopic" ; private static final String PERMISSION_ADMIN_MANAGE_TOPIC_PURGE_TOPIC = "//permission//admin//manage//topic//purgeTopic" ; private static final String PERMISSION_ADMIN_MANAGE_DLC_BROWSE_DLC = "//permission//admin//manage//dlc//browseDlc" ; public static Result handleCreateQueue ( String username , UserRealm userRealm , ObjectProperties properties ) throws QpidAuthorizationHandlerException { } public static Result handleConsumeQueue ( String username , UserRealm userRealm , ObjectProperties properties ) throws QpidAuthorizationHandlerException { } public static Result handleBindQueue ( String username , UserRealm userRealm , ObjectProperties properties ) throws QpidAuthorizationHandlerException { } public static Result handlePublishToExchange ( String username , UserRealm userRealm , ObjectProperties properties ) throws QpidAuthorizationHandlerException { } public static Result handleUnbindQueue ( ObjectProperties properties ) throws QpidAuthorizationHandlerException { } public static Result handleDeleteQueue ( String username , UserRealm userRealm , ObjectProperties properties ) throws QpidAuthorizationHandlerException { } public static Result handlePurgeQueue ( String username , UserRealm userRealm , ObjectProperties properties ) throws QpidAuthorizationHandlerException { } private static String getRawQueueName ( String queueName ) { } private static String getRawRoutingKey ( String routingKey ) { <START_BUG> return routingKey . substring ( ( ( routingKey . indexOf ( ":" ) ) + 1 ) , routingKey . length ( ) ) ; <END_BUG> } private static String getRawExchangeName ( String exchangeName ) { } private static boolean isAdminUser ( String username , UserRealm userRealm ) { } private static boolean isOwnDomain ( String tenantDomain , String routingKey ) { } private static boolean isTopicSubscriberQueue ( String queueName ) { } }

Fix:
return routingKey . substring ( ( ( routingKey . indexOf ( "carbon:" ) ) + 1 ) , routingKey . length ( ) ) ;