Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package gov.nist.javax.sip.header;
 

Author(s):
yanick.belanger
 
public abstract class SIPHeaderNamesCache
    private static final HashMap lowercaseMap = new HashMap();
    static {
        Field[] fields = SIPHeaderNames.class.getFields();
        for (int i = 0; i < fields.lengthi++) {
            Field field = fields[i];
            if (field.getType().equals(String.class) && Modifier.isStatic(field.getModifiers())) {
                try {
                    String value = (Stringfield.get(null);
                    String lowerCase = value.toLowerCase();
                    .put(valuelowerCase);
                    .put(lowerCaselowerCase);
                } catch (IllegalAccessException e) {
                }
            }
        }
    }
    public static String toLowerCase(String headerName) {
        String lowerCase = (String.get(headerName);
        if (lowerCase == null) {
            return headerName.toLowerCase();
        }
        else {
            return lowerCase;
        }
    }
New to GrepCode? Check out our FAQ X