src/share/jaxws_classes/com/sun/xml/internal/stream/buffer/stax/NamespaceContexHelper.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * 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,13 +72,10 @@
// 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() {
@@ -86,11 +83,11 @@
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;
+ namespacePosition = 2;
}
// NamespaceContext interface
@@ -255,11 +252,11 @@
*/
public void pushContext() {
if (contextPosition == contexts.length)
resizeContexts();
- contexts[contextPosition++] = currentContext = namespacePosition;
+ contexts[contextPosition++] = namespacePosition;
}
private void resizeContexts() {
int[] newContexts = new int[contexts.length * 3 / 2 + 1];
System.arraycopy(contexts, 0, newContexts, 0, contexts.length);
@@ -272,18 +269,18 @@
* 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];
+ namespacePosition = contexts[--contextPosition];
}
}
/**
* Reset namespace contexts.
* <p>
* Pop all namespace contexts and reset the root context.
*/
public void resetContexts() {
- currentContext = namespacePosition = 2;
+ namespacePosition = 2;
}
}