List of usage examples for com.google.common.primitives Chars saturatedCast
public static char saturatedCast(long value)
From source file:org.apache.james.server.core.MailImpl.java
private static void detectPossibleLoop(String currentName, int loopThreshold, char separator) throws MessagingException { long occurrences = currentName.chars().filter(c -> Chars.saturatedCast(c) == separator).count(); // It looks like a configuration loop. It's better to stop. if (occurrences > loopThreshold) { throw new MessagingException( "Unable to create a new message name: too long. Possible loop in config.xml."); }//w w w.j a va 2s.c o m }