Greedy - accepts \n and \r\n
This checker consumes silently the second control-character...

@return true if the given character is a line-terminator
555678
private boolean isEndOfLine(int c) throws IOException {
        // check if we have \r\n...
        if (c == '\r') {
            if (in.lookAhead() == '\n') {
                // note: does not change c outside of this method !!
                c = in.read();
            }
        }
        return (c == '\n');
    }
581635
public boolean isEndChar(char chChar)
    {
        if ((chChar == '\n')
            || (chChar == '\r')
            || (chChar == JAVA_NEW_LINE))
                return true;
        if (chChar == '<')
            return true;
        return false;
    }
416467
boolean checkSuffix(char[] chars, int[] cursor) {
    if (suffix == null)
      return true;
    // Compute the only possible starting point. This only works because a clause's minlen
    // is an exact length for SQL-style patterns.  This method is overridden for topic
    // patterns.
    int start = cursor[1] - suffix.minlen;
    if (start < cursor[0])
      // candidate is too short to possibly match
      return false;
    if (!matchClause(suffix, chars, new int[] {start, cursor[1]}))
      return false;
    // The suffix matches, so reflect that in the cursor
    cursor[1] = start;
    return true;
  }
1356379
def newline_before_nonwhitespace(string)
      offset = -2
      while /\S/.match(string[offset]).nil?
        return true if string[offset] == "\n"
        offset -= 1
      end
      false
    end
810012
final boolean lookahead(char c, int n)
  {

    int pos = (m_queueMark + n);
    boolean b;

    if ((pos <= m_ops.getTokenQueueSize()) && (pos > 0)
            && (m_ops.getTokenQueueSize() != 0))
    {
      String tok = ((String) m_ops.m_tokenQueue.elementAt(pos - 1));

      b = (tok.length() == 1) ? (tok.charAt(0) == c) : false;
    }
    else
    {
      b = false;
    }

    return b;
  }
904418
private boolean htmlSentenceTerminatorFound(String str, int index) {
        for (int i = 0; i < sentenceTerminators.length; i++) {
            String terminator = sentenceTerminators[i];
            if (str.regionMatches(true, index, terminator,
                                  0, terminator.length())) {
                    return true;
            }
        }
        return false;
    }
1256661
private static boolean isSafeFilenameCharacter(char c)
	{
		if (Character.isLetterOrDigit(c))
		{
			return true;
		}
		else if (c == '-' || c == '_' || c == '.')
		{
			return true;
		}
		else
		{
			return false;
		}
	}
384081
public static boolean isMessyCode(String strName) {
        Pattern p = Pattern.compile("\\s*|t*|r*|n*");
        Matcher m = p.matcher(strName);
        String after = m.replaceAll("");
        String temp = after.replaceAll("\\p{P}", "");
        char[] ch = temp.trim().toCharArray();
        float chLength = ch.length;
        float count = 0;
        for (int i = 0; i < ch.length; i++) {
            char c = ch[i];
            if (!Character.isLetterOrDigit(c)) {
                if (!isChinese(c)) {
                    count = count + 1;
                }
            }
        }
        float result = count / chLength;
        if (result > 0.4) {
            return true;
        } else {
            return false;
        }
 
    }
472512
private boolean previousSegment() {
        assert(state == State.ITER_CHECK_BWD);
        // The input text [(iter index)..limit[ passes the FCD check.
        pos = iter.getIndex();
        // Collect the characters being checked, in case they need to be normalized.
        if(s == null) {
            s = new StringBuilder();
        } else {
            s.setLength(0);
        }
        int nextCC = 0;
        for(;;) {
            // Fetch the previous character and its fcd16 value.
            int c = iter.previousCodePoint();
            if(c < 0) { break; }
            int fcd16 = nfcImpl.getFCD16(c);
            int trailCC = fcd16 & 0xff;
            if(trailCC == 0 && s.length() != 0) {
                // FCD boundary after this character.
                iter.nextCodePoint();
                break;
            }
            s.appendCodePoint(c);
            if(trailCC != 0 && ((nextCC != 0 && trailCC > nextCC) ||
                                CollationFCD.isFCD16OfTibetanCompositeVowel(fcd16))) {
                // Fails FCD check. Find the previous FCD boundary and normalize.
                while(fcd16 > 0xff) {
                    c = iter.previousCodePoint();
                    if(c < 0) { break; }
                    fcd16 = nfcImpl.getFCD16(c);
                    if(fcd16 == 0) {
                        iter.nextCodePoint();
                        break;
                    }
                    s.appendCodePoint(c);
                }
                s.reverse();
                normalize(s);
                limit = pos;
                start = pos - s.length();
                state = State.IN_NORM_ITER_AT_START;
                pos = normalized.length();
                return true;
            }
            nextCC = fcd16 >> 8;
            if(nextCC == 0) {
                // FCD boundary before the following character.
                break;
            }
        }
        start = pos - s.length();
        assert(pos != start);
        iter.moveIndex(s.length());
        state = State.ITER_IN_FCD_SEGMENT;
        return true;
    }
1331091
public static boolean isAllLetter(String text)
    {
        for (int i = 0; i < text.length(); ++i)
        {
            char c = text.charAt(i);
            if ((((c < 'a' || c > 'z')) && ((c < 'A' || c > 'Z'))))
            {
                return false;
            }
        }

        return true;
    }
690248
public static boolean hasSingleCharacterArg(Closure c) {
        if (c.getMaximumNumberOfParameters() != 1) return false;
        String typeName = c.getParameterTypes()[0].getName();
        return typeName.equals("char") || typeName.equals("java.lang.Character");
    }
1145452
protected boolean isDelimiter( String character ) {
        String operands = ";:{}()[]+-/%<=>!&|^~*";
        if (Character.isWhitespace(character.charAt(0)) || operands.indexOf(character) != -1)
            return true;
        else
            return false;
    }
979997
private static boolean consumesDanglingElse(Node n) {
    while (true) {
      switch (n.getToken()) {
        case IF:
          if (n.getChildCount() < 3) {
            return true;
          }
          // This IF node has no else clause.
          n = n.getLastChild();
          continue;
        case BLOCK:
          if (!n.hasOneChild()) {
            return false;
          }
          // This BLOCK has no curly braces.
          n = n.getLastChild();
          continue;
        case WITH:
        case WHILE:
        case FOR:
        case FOR_IN:
          n = n.getLastChild();
          continue;
        default:
          return false;
      }
    }
  }
877535
private boolean readNextLine() throws IOException {
        boolean newLine = false;
        if (bufferLimit > 0 && !bufferLineEnd) {
            // check for "last line"
            if (bufferLimit < buffer.length) {
                return false;
            }
        } else {
            newLine = true;
        }

        bufferLineEnd = false;

        int off = 0;
        char[] b = new char[1];
        while (off < buffer.length && reader.read(b, 0, 1) > 0) {
            final char ch = b[0];
            buffer[off] = ch;
            ++off;
            if (ch == '\n') {
                bufferLineEnd = true;
                break;
            }
        }
        if (off > 0) {
            if (newLine) {
                ++lineNo;
                linePos = 0;
            }
            if (off < buffer.length) {
                buffer[off] = 0;
            }
            bufferOffset = -1;
            bufferLimit = off;
            return true;
        }
        return false;
    }
821952
private int tailingNonNewline(char[] cbuf, int off, int len) {
    for(int cnt = 0; cnt < len; cnt++) {
      final int pos = off + (len - 1) - cnt;
      if(cbuf[pos] == UNIX_NEWLINE) {
        return cnt;
      }
      if(cbuf[pos] == CARRIAGE_RETURN) {
        return cnt;
      }
      // TODO: need to compare to NEWLINEC, too?
    }
    return len;
  }
356169
public boolean supports(final String line) {
        final List<String> splits = new ArrayList<String>();
        int depth = 0;
        int textDepth = 0;
        boolean escape = false;
        StringBuffer split = new StringBuffer();
        for (char c : line.toCharArray()) {
            if (depth == 0 && c == '.') {
                splits.add(split.toString());
                split = new StringBuffer();
                depth = 0;
                textDepth = 0;
                escape = false;
                continue;
            } else if (c == '\\') {
                escape = true;
                split.append(c);
                continue;
            } else if (textDepth == 0 && c == '"') {
                textDepth++;
            } else if (!escape && textDepth > 0 && c == '"') {
                textDepth--;
            } else if (textDepth == 0 && c == '(') {
                depth++;
            } else if (textDepth == 0 && c == ')') {
                depth--;
            }
            split.append(c);
            escape = false;
        }
        splits.add(split.toString());
        return splits.size() == 2;
    }
605041
private boolean isAlphanumericOrPlusMinusPoint(char character) {
        return (character >= 'A' && character <= 'Z') // Unicode A..Z
                || (character >= 'a' && character <= 'z') // Unicode a..z
                || (character >= '0' && character <= '9') // Unicode 0..9
                || character == '+' || character == '-' || character == '.';
    }