Mistři v programování na #hovnokod

Java #3847

private static boolean isMethodSupported(String name, Class<?> returnType)
{
    // The UI doesn't need any of those
    if(void.class.equals(returnType)
    || "equals".equals(name)
    || "hashCode".equals(name)
    || "size".equals(name)
    || "toArray".equals(name)
    || "iterator".equals(name)
    || "toString".equals(name)
    || "clone".equals(name))
    {
        return false;
    }
    if((Boolean.class.equals(returnType) 
     || boolean.class.equals(returnType))
    && (name.startsWith("has") 
     || name.startsWith("is")))
    {
        return true;
    }
    if(name.startsWith("get"))
    {
        return true;
    }
    return false;
}

Anonymous,