linter/src/main/java/org/apache/royale/linter/internal/config/FileConfigurator.java [255:340]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public void endElement(String uri, String localName, String qname) throws SAXException
        {
            final ParseContext ctx = contextStack.peek();

            if (ctx.ignore)
            {
                // if found the matching end element, then pop the context and stop ignoring input
                if (ctx.item.equals(qname))
                {
                    contextStack.pop();
                    text.setLength(0); // ignore any text read
                }

                return;
            }

            // There are four possible states here;
            // 1. localname==rootElement -> end of file, pop, we're done
            // 2. localname==itemElement -> finished gathering text, push onto arglist
            // 2. var is set -> set the var to the argList, pop
            // 3. var is null -> we're finishing a child config, pop

            if (qname.equals(rootElement))
            {
                // Finished with the file!
            }
            else if (ctx.item != null)
            {
                // Finished with the current item.
                final ParseValue v = new ParseValue();
                v.name = qname;
                v.value = text.toString();
                v.line = locator.getLineNumber();
                ctx.argList.add(v);
                text.setLength(0);
                ctx.item = null;
            }
            else if (ctx.var != null)
            {
                if ((ctx.varArgCount > 1) && (ctx.argList.size() == 0))
                {
                    throw new SAXConfigurationException(
                            new ConfigurationException.IncorrectArgumentCount(ctx.varArgCount, 0,
                                                                               ctx.var, source, locator.getLineNumber()),
                            locator);
                }
                if (ctx.varArgCount == 1)
                {
                    ParseValue v = new ParseValue();
                    v.name = null;
                    v.value = text.toString();
                    v.line = locator.getLineNumber();
                    ctx.argList.add(v);
                    text.setLength(0);
                }
                else
                {
                    if (text.length() > 0)
                    {
                        // "unexpected CDATA encountered, " + ctx.var + " requires named arguments.", locator );
                        throw new SAXConfigurationException(
                                new ConfigurationException.UnexpectedCDATA(source, locator.getLineNumber()),
                                locator);

                    }
                }
                // Finished with the current var, save the current list
                try
                {
                    setVar(ctx.var, ctx.argList, locator.getLineNumber(), ctx.append);
                    ctx.var = null;
                    ctx.argList.clear();
                    ctx.item = null;
                    ctx.append = false;
                }
                catch (ConfigurationException e)
                {
                    throw new SAXConfigurationException(e, locator);
                }
            }
            else
            {
                // done with a child config
                contextStack.pop();
            }
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



compiler-common/src/main/java/org/apache/royale/compiler/internal/config/FileConfigurator.java [255:340]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public void endElement(String uri, String localName, String qname) throws SAXException
        {
            final ParseContext ctx = contextStack.peek();

            if (ctx.ignore)
            {
                // if found the matching end element, then pop the context and stop ignoring input
                if (ctx.item.equals(qname))
                {
                    contextStack.pop();
                    text.setLength(0); // ignore any text read
                }

                return;
            }

            // There are four possible states here;
            // 1. localname==rootElement -> end of file, pop, we're done
            // 2. localname==itemElement -> finished gathering text, push onto arglist
            // 2. var is set -> set the var to the argList, pop
            // 3. var is null -> we're finishing a child config, pop

            if (qname.equals(rootElement))
            {
                // Finished with the file!
            }
            else if (ctx.item != null)
            {
                // Finished with the current item.
                final ParseValue v = new ParseValue();
                v.name = qname;
                v.value = text.toString();
                v.line = locator.getLineNumber();
                ctx.argList.add(v);
                text.setLength(0);
                ctx.item = null;
            }
            else if (ctx.var != null)
            {
                if ((ctx.varArgCount > 1) && (ctx.argList.size() == 0))
                {
                    throw new SAXConfigurationException(
                            new ConfigurationException.IncorrectArgumentCount(ctx.varArgCount, 0,
                                                                               ctx.var, source, locator.getLineNumber()),
                            locator);
                }
                if (ctx.varArgCount == 1)
                {
                    ParseValue v = new ParseValue();
                    v.name = null;
                    v.value = text.toString();
                    v.line = locator.getLineNumber();
                    ctx.argList.add(v);
                    text.setLength(0);
                }
                else
                {
                    if (text.length() > 0)
                    {
                        // "unexpected CDATA encountered, " + ctx.var + " requires named arguments.", locator );
                        throw new SAXConfigurationException(
                                new ConfigurationException.UnexpectedCDATA(source, locator.getLineNumber()),
                                locator);

                    }
                }
                // Finished with the current var, save the current list
                try
                {
                    setVar(ctx.var, ctx.argList, locator.getLineNumber(), ctx.append);
                    ctx.var = null;
                    ctx.argList.clear();
                    ctx.item = null;
                    ctx.append = false;
                }
                catch (ConfigurationException e)
                {
                    throw new SAXConfigurationException(e, locator);
                }
            }
            else
            {
                // done with a child config
                contextStack.pop();
            }
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



formatter/src/main/java/org/apache/royale/formatter/internal/config/FileConfigurator.java [254:339]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public void endElement(String uri, String localName, String qname) throws SAXException
        {
            final ParseContext ctx = contextStack.peek();

            if (ctx.ignore)
            {
                // if found the matching end element, then pop the context and stop ignoring input
                if (ctx.item.equals(qname))
                {
                    contextStack.pop();
                    text.setLength(0); // ignore any text read
                }

                return;
            }

            // There are four possible states here;
            // 1. localname==rootElement -> end of file, pop, we're done
            // 2. localname==itemElement -> finished gathering text, push onto arglist
            // 2. var is set -> set the var to the argList, pop
            // 3. var is null -> we're finishing a child config, pop

            if (qname.equals(rootElement))
            {
                // Finished with the file!
            }
            else if (ctx.item != null)
            {
                // Finished with the current item.
                final ParseValue v = new ParseValue();
                v.name = qname;
                v.value = text.toString();
                v.line = locator.getLineNumber();
                ctx.argList.add(v);
                text.setLength(0);
                ctx.item = null;
            }
            else if (ctx.var != null)
            {
                if ((ctx.varArgCount > 1) && (ctx.argList.size() == 0))
                {
                    throw new SAXConfigurationException(
                            new ConfigurationException.IncorrectArgumentCount(ctx.varArgCount, 0,
                                                                               ctx.var, source, locator.getLineNumber()),
                            locator);
                }
                if (ctx.varArgCount == 1)
                {
                    ParseValue v = new ParseValue();
                    v.name = null;
                    v.value = text.toString();
                    v.line = locator.getLineNumber();
                    ctx.argList.add(v);
                    text.setLength(0);
                }
                else
                {
                    if (text.length() > 0)
                    {
                        // "unexpected CDATA encountered, " + ctx.var + " requires named arguments.", locator );
                        throw new SAXConfigurationException(
                                new ConfigurationException.UnexpectedCDATA(source, locator.getLineNumber()),
                                locator);

                    }
                }
                // Finished with the current var, save the current list
                try
                {
                    setVar(ctx.var, ctx.argList, locator.getLineNumber(), ctx.append);
                    ctx.var = null;
                    ctx.argList.clear();
                    ctx.item = null;
                    ctx.append = false;
                }
                catch (ConfigurationException e)
                {
                    throw new SAXConfigurationException(e, locator);
                }
            }
            else
            {
                // done with a child config
                contextStack.pop();
            }
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



