Search in sources :

Example 16 with StringBuffer

use of java.lang.StringBuffer in project Payara by payara.

the class PEDomainConfigValidator method printDuplicatesFromMap.

/**
 * Return a string representation of the given map, but only for
 * those entries where the value has a size greater than 1
 * @param map a map of key to Set of value
 */
private final String printDuplicatesFromMap(final Map map) {
    final StringBuffer sb = new StringBuffer();
    final Iterator it = map.entrySet().iterator();
    Map.Entry entry = getNextDuplicate(it);
    if (entry != null) {
        printEntry(sb, entry);
        while ((entry = getNextDuplicate(it)) != null) {
            sb.append(", ");
            printEntry(sb, entry);
        }
    }
    return sb.toString();
}
Also used : Entry(java.util.Map.Entry) StringBuffer(java.lang.StringBuffer) Iterator(java.util.Iterator) TreeMap(java.util.TreeMap) Map(java.util.Map)

Aggregations

StringBuffer (java.lang.StringBuffer)16 IOException (java.io.IOException)6 BadRealmException (com.sun.enterprise.security.auth.realm.BadRealmException)3 InvalidOperationException (com.sun.enterprise.security.auth.realm.InvalidOperationException)3 NoSuchRealmException (com.sun.enterprise.security.auth.realm.NoSuchRealmException)3 NoSuchUserException (com.sun.enterprise.security.auth.realm.NoSuchUserException)3 NamingException (javax.naming.NamingException)3 LoginException (javax.security.auth.login.LoginException)3 BufferedReader (java.io.BufferedReader)2 FileInputStream (java.io.FileInputStream)2 Enumeration (java.util.Enumeration)2 HashMap (java.util.HashMap)2 Iterator (java.util.Iterator)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 DirContext (javax.naming.directory.DirContext)2 InitialDirContext (javax.naming.directory.InitialDirContext)2 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FileReader (java.io.FileReader)1