geronimo-mail_2.1_spec/src/main/java/jakarta/mail/internet/MimeUtility.java [134:181]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        int offset = 0;
        final int endOffset = text.length();

        int startWhiteSpace = -1;
        int endWhiteSpace = -1;

        final StringBuffer decodedText = new StringBuffer(text.length());

        boolean previousTokenEncoded = false;

        while (offset < endOffset) {
            char ch = text.charAt(offset);

            // is this a whitespace character?
            if (linearWhiteSpace.indexOf(ch) != -1) {
                startWhiteSpace = offset;
                while (offset < endOffset) {
                    // step over the white space characters.
                    ch = text.charAt(offset);
                    if (linearWhiteSpace.indexOf(ch) != -1) {
                        offset++;
                    }
                    else {
                        // record the location of the first non lwsp and drop down to process the
                        // token characters.
                        endWhiteSpace = offset;
                        break;
                    }
                }
            }
            else {
                // we have a word token.  We need to scan over the word and then try to parse it.
                final int wordStart = offset;

                while (offset < endOffset) {
                    // step over the white space characters.
                    ch = text.charAt(offset);
                    if (linearWhiteSpace.indexOf(ch) == -1) {
                        offset++;
                    }
                    else {
                        break;
                    }

                    //NB:  Trailing whitespace on these header strings will just be discarded.
                }
                // pull out the word token.
                final String word = text.substring(wordStart, offset);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-mail_2.1_spec/src/main/java/jakarta/mail/internet/MimeUtility.java [237:284]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        int offset = 0;
        final int endOffset = text.length();

        int startWhiteSpace = -1;
        int endWhiteSpace = -1;

        final StringBuffer decodedText = new StringBuffer(text.length());

        boolean previousTokenEncoded = false;

        while (offset < endOffset) {
            char ch = text.charAt(offset);

            // is this a whitespace character?
            if (linearWhiteSpace.indexOf(ch) != -1) {
                startWhiteSpace = offset;
                while (offset < endOffset) {
                    // step over the white space characters.
                    ch = text.charAt(offset);
                    if (linearWhiteSpace.indexOf(ch) != -1) {
                        offset++;
                    }
                    else {
                        // record the location of the first non lwsp and drop down to process the
                        // token characters.
                        endWhiteSpace = offset;
                        break;
                    }
                }
            }
            else {
                // we're at the start of a word token.  We potentially need to break this up into subtokens
                final int wordStart = offset;

                while (offset < endOffset) {
                    // step over the white space characters.
                    ch = text.charAt(offset);
                    if (linearWhiteSpace.indexOf(ch) == -1) {
                        offset++;
                    }
                    else {
                        break;
                    }

                    //NB:  Trailing whitespace on these header strings will just be discarded.
                }
                // pull out the word token.
                final String word = text.substring(wordStart, offset);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



