Returns {@code true} if the given class has a non-private default
constructor, or has no constructor at all.
964873
public static boolean hasAccessibleDefaultConstructor(Class<?> clazz) {
    Constructor<?> constructor;
    try {
      constructor = clazz.getDeclaredConstructor();
    } catch (NoSuchMethodException e) {
      return clazz.getDeclaredConstructors().length == 0;
    }

    return !isPrivate(constructor);
  }
1335628
def has_public_assign(class_):
    """"""
    class_ = class_traits.get_declaration(class_)
    decls = class_.member_operators(
        lambda o: o.symbol == '=' and o.access_type == 'public',
        recursive=False,
        allow_empty=True)
    return bool(decls)
520691
private boolean checkForDefaultImplementation(Class checkClass, String checkMethod, Class[] methodParams){
		
	    if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable (Level.FINE))  //306998.14
	    	logger.exiting(CLASS_NAME,"checkForDefaultImplementation","Method : " + checkMethod + ", Class : " + checkClass.getName());
		
		
		boolean defaultMethodInUse=true;
		
		while (defaultMethodInUse && checkClass!=null && !checkClass.getName().equals("javax.servlet.http.HttpServlet")) {
		    try {  
		    						       
		        checkClass.getDeclaredMethod(checkMethod, methodParams);
			
			    if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable (Level.FINE))  //306998.14
			    	logger.logp(Level.FINE, CLASS_NAME,"checkForDefaultImplementation","Class implementing " + checkMethod + " is " + checkClass.getName());
			
			    defaultMethodInUse=false;
			    break;
			     
		    } catch (java.lang.NoSuchMethodException exc) {    	
			    if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable (Level.FINE))  //306998.14
			    	logger.logp(Level.FINE, CLASS_NAME,"checkForDefaultImplementation",checkMethod + " is not implemented by class " + checkClass.getName()); 
		    } catch (java.lang.SecurityException exc) {
			    if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable (Level.FINE))  //306998.14
			    	logger.logp(Level.FINE, CLASS_NAME,"checkForDefaultImplementation","Cannot determine if " + checkMethod + " is implemented by class " + checkClass.getName());				    	
		    }
		    
		    checkClass = checkClass.getSuperclass();
	    }  
	    if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable (Level.FINE))  //306998.14
	    	logger.exiting(CLASS_NAME,"checkForDefaultImplementation","Result : " + defaultMethodInUse);
	    
        return defaultMethodInUse;
	}
1019630
public static boolean isSingleValueType(Class<?> type) {

        LettuceAssert.notNull(type, "Class must not be null!");

        return findDescriptor(type).map((descriptor) -> !descriptor.isMultiValue() && !descriptor.isNoValue()).orElse(false);
    }
1196674
private boolean isClientClass(String className, Set<ASMData> clientClasses)
	{
		for (ASMData data : clientClasses)
		{
			if (data.getClassName().equals(className) && data.getObjectName().equals(data.getClassName())
					&& ((ModAnnotation.EnumHolder) data.getAnnotationInfo().get("value")).getValue().equals("CLIENT"))
				return true;
		}
		return false;
	}
576397
public boolean isDefault() {
		return (valueAsString != null && valueAsString.equals(defaultValueAsString)) ||
				(valueAsString == null && defaultValueAsString == null);
	}
693677
private boolean canBeMadeFromString() {
        final Class<?> clazz = getClassForUnderlyingField();
        if (clazz.isEnum()) {
            return true;
        }
        try {
            // Need to use getDeclaredConstructor() instead of getConstructor() in case the constructor
            // is non-public
            clazz.getDeclaredConstructor(String.class);
            return true;
        } catch (final NoSuchMethodException e) {
            return false;
        }
    }
314230
@SuppressWarnings({ "rawtypes", "unchecked" })
    private static boolean isAnnotated(final Class clazz) {
        Plugin plugin = (Plugin) clazz.getAnnotation(Plugin.class);
        return plugin != null;
    }
1264096
public static boolean hasDefaultConstructor(TypeDef item) {
        if (item == null) {
            return false;
        } else if (item.getConstructors().isEmpty()) {
            return true;
        } else {
            for (Method constructor : item.getConstructors()) {
                if (constructor.getArguments().size() == 0) {
                    return true;
                }
            }
        }
        return false;
    }
337086
public boolean isInstance(Object o) {
        Class c = rawType();
        if (c.isInstance(o)) {
            return true;
        }
        Class p = $.primitiveTypeOf(c);
        if (null != p && p.isInstance(o)) {
            return true;
        }
        Class w = $.wrapperClassOf(c);
        if (null != w && w.isInstance(o)) {
            return true;
        }
        return false;
    }
879881
@SuppressWarnings("unchecked")
    public static <T> boolean hasClass(Class<T> type, ClassLoader classloader) {
        try {
            loadClass(type.getName(), classloader);
            return true;
        } catch (RuntimeException e) {
            if(e.getCause() instanceof ClassNotFoundException) {
                return false;
            }
            throw e;
        }
    }
78604
public static boolean isPropertyInitialized(Object object) {
    	Class < ? > cl =  getHibernateClass();
    	
        if (cl == null) {
            return true;
        }
        
        Method method = getInitializeMethod(cl);
        return checkInitialize(method, object);
    }
1012401
public static boolean isPrimitiveArray(Class<?> clazz) {
		Assert.notNull(clazz, "Class must not be null");
		return (clazz.isArray() && clazz.getComponentType().isPrimitive());
	}
295590
public static boolean hasPublicNullaryConstructor(Class<?> clazz) {
		Constructor<?>[] constructors = clazz.getConstructors();
		for (int i = 0; i < constructors.length; i++) {
			if (constructors[i].getParameterTypes().length == 0 && 
					Modifier.isPublic(constructors[i].getModifiers())) {
				return true;
			}
		}
		return false;
	}
777260
static <T> T getInstance(Class<T> clazz) {
        @SuppressWarnings("unchecked")
        final T casted = (T) instanceCache.computeIfAbsent(clazz, type -> {
            try {
                return getInstance0(clazz);
            } catch (Exception e) {
                throw new IllegalStateException("A class must have an accessible default constructor: " +
                                                clazz.getName(), e);
            }
        });
        return casted;
    }
113688
public static boolean hasDefaultConstructor(TypeRef item) {
        DefinitionRepository repository =  DefinitionRepository.getRepository();
        TypeDef def = repository.getDefinition(item);
        if (def == null && item instanceof ClassRef) {
            def = ((ClassRef)item).getDefinition();
        }
        return hasDefaultConstructor(def);
    }
894008
public boolean exists(String className) {
		if(this.classLoader!=null) {
			if(exists(className, this.classLoader)) {
				LOG.debug("class {} found using class specific class loader", className);
				return true;
			}
			return false;
		}
		if(existsWithDefaultClassLoader(className)) {
			LOG.debug("class {} found using default class loader", className);
			return true;
		}
		if(exists(className, Thread.currentThread().getContextClassLoader())) {
			LOG.debug("class {} found using class loader of current thread", className);
			return true;
		}
		if(exists(className, getClass().getClassLoader())) {
			LOG.debug("class {} found using class loader of current class", className);
			return true;
		}
		return false;
	}