@SuppressWarnings("unchecked") private StackNode<T> getUnusedStackNode() { // Search for an unused stack node. while (stackNodesIdx < numStackNodes) { if (stackNodes[stackNodesIdx].isUnused()) { return stackNodes[stackNodesIdx++]; } stackNodesIdx++; } if (stackNodesIdx < stackNodes.length) { // No unused stack nodes, but there is still space in the storage array. stackNodes[stackNodesIdx] = new StackNode<T>(stackNodesIdx); numStackNodes++; return stackNodes[stackNodesIdx++]; } // Could not find an unused stack node and storage array is full. StackNode<T>[] newStack = new StackNode[stackNodes.length + 64]; System.arraycopy(stackNodes, 0, newStack, 0, stackNodes.length); stackNodes = newStack; // Create a new stack node and return it. stackNodes[stackNodesIdx] = new StackNode<T>(stackNodesIdx); numStackNodes++; return stackNodes[stackNodesIdx++]; }
@SuppressWarnings("unchecked") private StackNode<T> getUnusedStackNode() { // Search for an unused stack node. while (stackNodesIdx < numStackNodes) { if (stackNodes[stackNodesIdx].isUnused()) { return stackNodes[stackNodesIdx++]; } stackNodesIdx++; } if (stackNodesIdx < stackNodes.length) { // No unused stack nodes, but there is still space in the storage array. stackNodes[stackNodesIdx] = new StackNode<T>(stackNodesIdx); numStackNodes++; return stackNodes[stackNodesIdx++]; } // Could not find an unused stack node and storage array is full. StackNode<T>[] newStack = new StackNode[stackNodes.length + 64]; System.arraycopy(stackNodes, 0, newStack, 0, stackNodes.length); stackNodes = newStack; // Create a new stack node and return it. stackNodes[stackNodesIdx] = new StackNode<T>(stackNodesIdx); numStackNodes++; return stackNodes[stackNodesIdx++]; }
/** * The common-case HTML setter. * * @param elementName * @param node * @param popName */ void setValues(ElementName elementName, T node, @Local String popName // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = popName; this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = null; this.refcount = 1; /* * Not used for formatting elements, so no need to track creator. */ // CPPONLY: this.htmlCreator = null; // [NOCPP[ this.locator = locator; // ]NOCPP] }
/** * The common-case HTML setter. * * @param elementName * @param node * @param popName */ void setValues(ElementName elementName, T node, @Local String popName // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = popName; this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = null; this.refcount = 1; /* * Not used for formatting elements, so no need to track creator. */ // CPPONLY: this.htmlCreator = null; // [NOCPP[ this.locator = locator; // ]NOCPP] }
assert isUnused(); this.flags = flags; this.name = name;
assert stackNodes[i].isUnused(); Portability.delete(stackNodes[i]);
assert isUnused(); this.flags = flags; this.name = name;
assert stackNodes[i].isUnused(); Portability.delete(stackNodes[i]);
/** * Short hand for well-known HTML elements. * * @param elementName * @param node */ void setValues(ElementName elementName, T node // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = elementName.getName(); this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = null; this.refcount = 1; assert elementName.isInterned() : "Don't use this constructor for custom elements."; /* * Not used for formatting elements, so no need to track creator. */ // CPPONLY: this.htmlCreator = null; // [NOCPP[ this.locator = locator; // ]NOCPP] }
/** * Setter for HTML formatting elements. * * @param elementName * @param node * @param attributes */ void setValues(ElementName elementName, T node, HtmlAttributes attributes // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = elementName.getName(); this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = attributes; this.refcount = 1; assert elementName.isInterned() : "Don't use this constructor for custom elements."; /* * Need to track creator for formatting elements in order to be able * to clone them. */ // CPPONLY: this.htmlCreator = elementName.getHtmlCreator(); // [NOCPP[ this.locator = locator; // ]NOCPP] }
assert isUnused(); this.flags = prepareSvgFlags(elementName.getFlags()); this.name = elementName.getName();
/** * Short hand for well-known HTML elements. * * @param elementName * @param node */ void setValues(ElementName elementName, T node // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = elementName.getName(); this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = null; this.refcount = 1; assert elementName.isInterned() : "Don't use this constructor for custom elements."; /* * Not used for formatting elements, so no need to track creator. */ // CPPONLY: this.htmlCreator = null; // [NOCPP[ this.locator = locator; // ]NOCPP] }
/** * Setter for HTML formatting elements. * * @param elementName * @param node * @param attributes */ void setValues(ElementName elementName, T node, HtmlAttributes attributes // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = elementName.getName(); this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = attributes; this.refcount = 1; assert elementName.isInterned() : "Don't use this constructor for custom elements."; /* * Need to track creator for formatting elements in order to be able * to clone them. */ // CPPONLY: this.htmlCreator = elementName.getHtmlCreator(); // [NOCPP[ this.locator = locator; // ]NOCPP] }
assert isUnused(); this.flags = prepareMathFlags(elementName.getFlags(), markAsIntegrationPoint);
assert isUnused(); this.flags = prepareSvgFlags(elementName.getFlags()); this.name = elementName.getName();
assert isUnused(); this.flags = prepareMathFlags(elementName.getFlags(), markAsIntegrationPoint);