Buggy code:
public class JBossAllXMLParsingProcessor implements DeploymentUnitProcessor { public static final String [ ] DEPLOYMENT_STRUCTURE_DESCRIPTOR_LOCATIONS = new String [ ] { "WEB-INF//jboss-all.xml" , "META-INF//jboss-all.xml" } ; private static final XMLInputFactory INPUT_FACTORY = XMLInputFactory . newInstance ( ) ; public static final String JBOSS = "jboss" ; @ Override public void deploy ( final DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final ResourceRoot root = deploymentUnit . getAttachment ( DEPLOYMENT_ROOT ) ; VirtualFile descriptor = null ; for ( final String loc : JBossAllXMLParsingProcessor . DEPLOYMENT_STRUCTURE_DESCRIPTOR_LOCATIONS ) { final VirtualFile file = root . getRoot ( ) . getChild ( loc ) ; if ( file . exists ( ) ) { descriptor = file ; break ; } } if ( descriptor == null ) { return ; } final XMLMapper mapper = Factory . create ( ) ; final Map < QName , AttachmentKey < ? > > namespaceAttachments = new HashMap < QName , AttachmentKey < ? > > ( ) ; for ( final JBossAllXMLParserDescription < ? > parser : deploymentUnit . getAttachmentList ( ATTACHMENT_KEY ) ) { namespaceAttachments . put ( parser . getRootElement ( ) , parser . getAttachmentKey ( ) ) ; mapper . registerRootElement ( parser . getRootElement ( ) , new JBossAllXMLElementReader ( parser ) ) ; } mapper . registerRootElement ( new QName ( JBossAllXMLParsingProcessor . Namespace . JBOSS_1_0 . getUriString ( ) , JBossAllXMLParsingProcessor . JBOSS ) , JBossAllXMLParsingProcessor . Parser . INSTANCE ) ; mapper . registerRootElement ( new QName ( JBossAllXMLParsingProcessor . Namespace . NONE . getUriString ( ) , JBossAllXMLParsingProcessor . JBOSS ) , JBossAllXMLParsingProcessor . Parser . INSTANCE ) ; final JBossAllXmlParseContext context = new JBossAllXmlParseContext ( deploymentUnit ) ; parse ( descriptor , mapper , context ) ; final Map < AttachmentKey < ? > , QName > usedNamespaces = new HashMap < AttachmentKey < ? > , QName > ( ) ; for ( Map . Entry < QName , Object > entry : context . getParseResults ( ) . entrySet ( ) ) { final AttachmentKey attachmentKey = namespaceAttachments . get ( entry . getKey ( ) ) ; if ( usedNamespaces . containsKey ( attachmentKey ) ) { <START_BUG> throw MESSAGES . equivalentNamespacesInJBossXml ( entry . getKey ( ) , usedNamespaces . get ( attachmentKey ) ) ; <END_BUG> } usedNamespaces . put ( attachmentKey , entry . getKey ( ) ) ; deploymentUnit . putAttachment ( attachmentKey , entry . getValue ( ) ) ; } } @ Override public void undeploy ( final DeploymentUnit context ) { } private void parse ( final VirtualFile file , final XMLMapper mapper , final JBossAllXmlParseContext context ) throws DeploymentUnitProcessingException { } private void setIfSupported ( final XMLInputFactory inputFactory , final String property , final Object value ) { } private void parse ( final InputStream source , final File file , final XMLMapper mapper , final JBossAllXmlParseContext context ) throws DeploymentUnitProcessingException { } private static void safeClose ( final Closeable closeable ) { } private static void safeClose ( final XMLStreamReader streamReader ) { } private static class Parser implements XMLElementReader < JBossAllXmlParseContext > { public static final JBossAllXMLParsingProcessor . Parser INSTANCE = new JBossAllXMLParsingProcessor . Parser ( ) ; @ Override public void readElement ( final XMLExtendedStreamReader reader , final JBossAllXmlParseContext context ) throws XMLStreamException { } private void parseJBossElement ( final XMLExtendedStreamReader reader , final JBossAllXmlParseContext context ) throws XMLStreamException { } } private static enum Element { JBOSS ( JBossAllXMLParsingProcessor . JBOSS ) , UNKNOWN ( "unknown" ) ; private final String name ; Element ( final String name ) { } public String getLocalName ( ) { } private static final Map < String , JBossAllXMLParsingProcessor . Element > MAP ; public static JBossAllXMLParsingProcessor . Element forName ( String localName ) { } } private static enum Namespace { UNKNOWN ( null ) , NONE ( null ) , XML_SCHEMA_INSTANCE ( "http:////www.w3.org//2001//XMLSchema-instance" ) , JBOSS_1_0 ( "urn:jboss:1.0" ) ; public static final JBossAllXMLParsingProcessor . Namespace CURRENT = JBossAllXMLParsingProcessor . Namespace . JBOSS_1_0 ; private final String name ; Namespace ( final String name ) { } public String getUriString ( ) { } private static final Map < String , JBossAllXMLParsingProcessor . Namespace > MAP ; public static JBossAllXMLParsingProcessor . Namespace forUri ( String uri ) { } } }

Fix:
MESSAGES . equivilentNamespacesInJBossXml ( entry . getKey ( ) , usedNamespaces . get ( attachmentKey ) ) ;