modules/json/src/org/apache/axis2/json/gson/GsonXMLStreamWriter.java [374:408]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void writeEndElement() throws XMLStreamException {
        if (!isProcessed) {
            try {
                process();
            } catch (IOException e) {
                throw new XMLStreamException("Error occours while write first begin object ");
            }
        }
        JsonObject stackObj;
        try {
            if (flushObject != null) {
                if (topNestedArrayObj != null && flushObject.getType() == JSONType.NESTED_ARRAY &&
                        flushObject.equals(topNestedArrayObj.getName())) {
                    topNestedArrayObj = null;
                    processedJsonObjects.clear();
                }
                popStack();
                writeEndJson(flushObject);
                flushObject = null;
                writeEndElement();
            } else {
                if (stack.peek().getType() == JSONType.ARRAY) {
                    flushObject = stack.peek();
                } else if (stack.peek().getType() == JSONType.NESTED_ARRAY) {
                    flushObject = stack.peek();
                    jsonWriter.endObject();
                } else {
                    stackObj = popStack();
                    writeEndJson(stackObj);
                }
            }
        } catch (IOException e) {
            throw new XMLStreamException("Json writer throw an exception");
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/json/src/org/apache/axis2/json/moshi/MoshiXMLStreamWriter.java [376:410]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public void writeEndElement() throws XMLStreamException {
        if (!isProcessed) {
            try {
                process();
            } catch (IOException e) {
                throw new XMLStreamException("Error occours while write first begin object ");
            }
        }
        JsonObject stackObj;
        try {
            if (flushObject != null) {
                if (topNestedArrayObj != null && flushObject.getType() == JSONType.NESTED_ARRAY &&
                        flushObject.equals(topNestedArrayObj.getName())) {
                    topNestedArrayObj = null;
                    processedJsonObjects.clear();
                }
                popStack();
                writeEndJson(flushObject);
                flushObject = null;
                writeEndElement();
            } else {
                if (stack.peek().getType() == JSONType.ARRAY) {
                    flushObject = stack.peek();
                } else if (stack.peek().getType() == JSONType.NESTED_ARRAY) {
                    flushObject = stack.peek();
                    jsonWriter.endObject();
                } else {
                    stackObj = popStack();
                    writeEndJson(stackObj);
                }
            }
        } catch (IOException e) {
            throw new XMLStreamException("Json writer throw an exception");
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



