0

I was recently debugging some code which led me through an exercise of stepping through the source for the String class. While looking through the code, I came across:

/* Now check if there are any characters that need to be changed. */
    scan: {
        for (firstUpper = 0 ; firstUpper < len; ) {
            char c = value[firstUpper];
            if ((c >= Character.MIN_HIGH_SURROGATE)
                    && (c <= Character.MAX_HIGH_SURROGATE)) {
                int supplChar = codePointAt(firstUpper);
                if (supplChar != Character.toLowerCase(supplChar)) {
                    break scan;
                }
                firstUpper += Character.charCount(supplChar);
            } else {
                if (c != Character.toLowerCase(c)) {
                    break scan;
                }
                firstUpper++;
            }
        }
        return this;
    }

I don't think I've ever seen the scan keyword. I did an internet search and even read the Java keyword spec, but it doesn't mention scan as an official keyword. Can anyone point me to some documentation on this keyword/token/feature?

klactose
  • 1,190
  • 2
  • 9
  • 26

0 Answers0