Retrieves the logical class name of a Micronaut artifact given the Micronaut class
and a specified trailing name.

@param clazz        The class
@param trailingName The trailing name such as "Controller" or "Service"
@return The logical class name
963880
public static String getLogicalName(Class<?> clazz, String trailingName) {
        return getLogicalName(clazz.getName(), trailingName);
    }
1169280
public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> clazz) {
        return getExtensionLoader(clazz, null);
    }
813535
public static List<String> getNames(Class<? extends Enum<?>> clazz) {
		final Enum<?>[] enums = clazz.getEnumConstants();
		if (null == enums) {
			return null;
		}
		final List<String> list = new ArrayList<>(enums.length);
		for (Enum<?> e : enums) {
			list.add(e.name());
		}
		return list;
	}
186146
private static String discoverClassName(ClassLoader tccl) {
        String className = null;

        // First services API
        className = getClassNameServices(tccl);
        if (className == null) {
            if (IS_SECURITY_ENABLED) {
                className = AccessController.doPrivileged(
                                new PrivilegedAction<String>() {
                                    @Override
                                    public String run() {
                                        return getClassNameJreDir();
                                    }
                                }
                                );
            } else {
                // Second el.properties file
                className = getClassNameJreDir();
            }
        }
        if (className == null) {
            if (IS_SECURITY_ENABLED) {
                className = AccessController.doPrivileged(
                                new PrivilegedAction<String>() {
                                    @Override
                                    public String run() {
                                        return getClassNameSysProp();
                                    }
                                }
                                );
            } else {
                // Third system property
                className = getClassNameSysProp();
            }
        }
        if (className == null) {
            // Fourth - default
            className = "org.apache.el.ExpressionFactoryImpl";
        }
        return className;
    }
736093
@SuppressWarnings("unchecked")
	public static <T extends ExtensionPoint<?>> T getExtensionPoint(Class<T> clazz) {
		synchronized (points) {
			for (ExtensionPoint<?> ep : points)
				if (clazz.isAssignableFrom(ep.getClass()))
					return (T)ep;
		}
		return null;
	}
1238851
public static Logger getLogger(Class<?> clazz) {
        return Logger.getLogger(Checker.isNull(clazz) ? LOCAL_CLASS : clazz);
    }
991099
public static String getPackageResourcesBaseName( Class clazz )
    {
        final Package pkg = clazz.getPackage();

        String baseName;
        if( null == pkg )
        {
            String name = clazz.getName();
            if( -1 == name.lastIndexOf( "." ) )
            {
                baseName = "Resources";
            }
            else
            {
                baseName = name.substring( 0, name.lastIndexOf( "." ) ) + ".Resources";
            }
        }
        else
        {
            baseName = pkg.getName() + ".Resources";
        }

        return baseName;
    }
1190773
public static Class<? extends Iced> getImplClass(Class<? extends Schema> clz) {
    Class<? extends Iced> impl_class = ReflectionUtils.findActualClassParameter(clz, 0);
    if (null == impl_class)
      Log.warn("Failed to find an impl class for Schema: " + clz);
    return impl_class;
  }
1179298
public boolean isArtefactClass(@SuppressWarnings("rawtypes") Class clazz) {
        if (clazz == null) return false;

        boolean ok = clazz.getName().endsWith(artefactSuffix) && !Closure.class.isAssignableFrom(clazz);
        if (ok && !allowAbstract) {
            ok &= !Modifier.isAbstract(clazz.getModifiers());
        }
        return ok;
    }
460093
public static String getClassFieldNameWithValue(Class clazz, Object value) {
		Field[] fields = clazz.getFields();
		for (int i = 0; i < fields.length; i++) {
			Field field = fields[i];
			try {
				Object constant = field.get(null);
				if (value.equals(constant)) {
					return clazz.getName() + "." + field.getName();
				}
			}
			catch (Exception e) {
				e.printStackTrace();
			}
		}
		return null;
	}
760538
public static String packageNameOf(Class<?> clazz) {
        String name = clazz.getName();
        int pos = name.lastIndexOf('.');
        E.unexpectedIf(pos < 0, "Class does not have package: " + name);
        return name.substring(0, pos);
    }
1236021
private static String getClassName(Class<?> clazz) {
		String name = clazz.getSimpleName();
		int dotPos = name.lastIndexOf('.');
		return dotPos==-1 ? name : name.substring(dotPos+1);
	}
431016
private static boolean localNameIsDeclaredByClass(Node clazz) {
    checkArgument(clazz.isClass(), clazz);

    if (clazz.getFirstChild().isEmpty()) {
      return false; // There must be a name.
    } else if (NodeUtil.isStatement(clazz)) {
      return false; // The name must be local.
    }

    return true;
  }
1364896
public static ClassLoader getClassLoader(Class clazz){
        ClassLoader classLoader = clazz.getClassLoader();
        return classLoader==null ? ClassLoader.getSystemClassLoader() : classLoader;
    }
1195587
protected Class<?> getUsefulClass(Class<?> clazz) {
		// com.demo.blog.Blog$$EnhancerByCGLIB$$69a17158
		// return (Class<? extends Model>)((modelClass.getName().indexOf("EnhancerByCGLIB") == -1 ? modelClass : modelClass.getSuperclass()));
		return (Class<?>)(clazz.getName().indexOf("$$EnhancerBy") == -1 ? clazz : clazz.getSuperclass());
	}
179976
private static <T> String getTableName(Class<T> clazz) {
		
		Table tableAnno = clazz.getAnnotation(Table.class);
		if(tableAnno != null){
			if(tableAnno.catalog() != null){
				return tableAnno.catalog() + "." + tableAnno.name();
			}
			return tableAnno.name();
		}
		//if Table annotation is null
		String className = clazz.getName();
		return IdUtils.toUnderscore(className.substring(className.lastIndexOf(".")+1));
	}
1368343
public static String getShortClassName( Class<?> clazz )
    {
        String className = clazz.getName();
        int idx = className.lastIndexOf('.');
        return (idx == -1 ? className : className.substring(idx+1));
    }