src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/stax/NamespaceContexHelper.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 72,84 **** // The namespace contexts private int[] contexts = new int[DEFAULT_SIZE]; // Current position to store the next namespace context private int contextPosition; - // The current namespace context - private int currentContext; - /** * Create a new NamespaceContexHelper. * */ public NamespaceContexHelper() { --- 72,81 ----
*** 86,96 **** prefixes[0] = "xml"; namespaceURIs[0] = "http://www.w3.org/XML/1998/namespace"; prefixes[1] = "xmlns"; namespaceURIs[1] = "http://www.w3.org/2000/xmlns/"; ! currentContext = namespacePosition = 2; } // NamespaceContext interface --- 83,93 ---- prefixes[0] = "xml"; namespaceURIs[0] = "http://www.w3.org/XML/1998/namespace"; prefixes[1] = "xmlns"; namespaceURIs[1] = "http://www.w3.org/2000/xmlns/"; ! namespacePosition = 2; } // NamespaceContext interface
*** 255,265 **** */ public void pushContext() { if (contextPosition == contexts.length) resizeContexts(); ! contexts[contextPosition++] = currentContext = namespacePosition; } private void resizeContexts() { int[] newContexts = new int[contexts.length * 3 / 2 + 1]; System.arraycopy(contexts, 0, newContexts, 0, contexts.length); --- 252,262 ---- */ public void pushContext() { if (contextPosition == contexts.length) resizeContexts(); ! contexts[contextPosition++] = namespacePosition; } private void resizeContexts() { int[] newContexts = new int[contexts.length * 3 / 2 + 1]; System.arraycopy(contexts, 0, newContexts, 0, contexts.length);
*** 272,289 **** * Namespaces declared within the context (to be popped) * will be removed and no longer be in scope. */ public void popContext() { if (contextPosition > 0) { ! namespacePosition = currentContext = contexts[--contextPosition]; } } /** * Reset namespace contexts. * <p> * Pop all namespace contexts and reset the root context. */ public void resetContexts() { ! currentContext = namespacePosition = 2; } } --- 269,286 ---- * Namespaces declared within the context (to be popped) * will be removed and no longer be in scope. */ public void popContext() { if (contextPosition > 0) { ! namespacePosition = contexts[--contextPosition]; } } /** * Reset namespace contexts. * <p> * Pop all namespace contexts and reset the root context. */ public void resetContexts() { ! namespacePosition = 2; } }