geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/AddressParser.java [976:1024]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void validateGroup(TokenStream tokens) throws AddressException {
        // we know already this is an address in the form "phrase:group;".  Now we need to validate the
        // elements.

        int phraseCount = 0;

        AddressToken token = tokens.nextRealToken();
        // now scan to the colon, ensuring we have only word or comment tokens.
        while (token.type != COLON) {
            // only these tokens are allowed here.
            if (token.type != ATOM && token.type != QUOTED_LITERAL) {
                invalidToken(token);
            }
            phraseCount++;
            token = tokens.nextRealToken();
        }


        // RFC822 groups require a leading phrase in group specifiers.
        if (phraseCount == 0) {
            illegalAddress("Missing group identifier phrase", token);
        }

        // now we do the remainder of the parsing using the initial phrase list as the sink...the entire
        // address will be converted to a string later.

        // ok, we only know this has been valid up to the ":", now we have some real checks to perform.
        while (true) {
            // go scan off a mailbox.  if everything goes according to plan, we should be positioned at either
            // a comma or a semicolon.
            validateGroupMailbox(tokens);

            token = tokens.nextRealToken();

            // we're at the end of the group.  Make sure this is truely the end.
            if (token.type == SEMICOLON) {
                token = tokens.nextRealToken();
                if (token.type != END_OF_TOKENS) {
                    illegalAddress("Illegal group address", token);
                }
                return;
            }

            // if not a semicolon, this better be a comma.
            else if (token.type != COMMA) {
                illegalAddress("Illegal group address", token);
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.5_spec/src/main/java/javax/mail/internet/AddressParser.java [974:1022]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void validateGroup(final TokenStream tokens) throws AddressException {
        // we know already this is an address in the form "phrase:group;".  Now we need to validate the
        // elements.

        int phraseCount = 0;

        AddressToken token = tokens.nextRealToken();
        // now scan to the semi color, ensuring we have only word or comment tokens.
        while (token.type != COLON) {
            // only these tokens are allowed here.
            if (token.type != ATOM && token.type != QUOTED_LITERAL) {
                invalidToken(token);
            }
            phraseCount++;
            token = tokens.nextRealToken();
        }


        // RFC822 groups require a leading phrase in group specifiers.
        if (phraseCount == 0) {
            illegalAddress("Missing group identifier phrase", token);
        }

        // now we do the remainder of the parsing using the initial phrase list as the sink...the entire
        // address will be converted to a string later.

        // ok, we only know this has been valid up to the ":", now we have some real checks to perform.
        while (true) {
            // go scan off a mailbox.  if everything goes according to plan, we should be positioned at either
            // a comma or a semicolon.
            validateGroupMailbox(tokens);

            token = tokens.nextRealToken();

            // we're at the end of the group.  Make sure this is truely the end.
            if (token.type == SEMICOLON) {
                token = tokens.nextRealToken();
                if (token.type != END_OF_TOKENS) {
                    illegalAddress("Illegal group address", token);
                }
                return;
            }

            // if not a semicolon, this better be a comma.
            else if (token.type != COMMA) {
                illegalAddress("Illegal group address", token);
            }
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



