Converts a binary class name (dotted) to the JVM internal one (slashed). Only accepts valid class names, no arrays.
508978
public static String binaryToInternal(String clazz) {
    if (clazz.indexOf('/') >= 0 || clazz.indexOf('[') >= 0) {
      throw new IllegalArgumentException(String.format(Locale.ENGLISH, "'%s' is not a valid binary class name.", clazz));
    }
    return clazz.replace('.', '/');
  }
684931
public static String getShortClassName(String className) {
		final List<String> packages = StrUtil.split(className, CharUtil.DOT);
		if (null == packages || packages.size() < 2) {
			return className;
		}

		final int size = packages.size();
		final StringBuilder result = StrUtil.builder();
		result.append(packages.get(0).charAt(0));
		for (int i = 1; i < size - 1; i++) {
			result.append(CharUtil.DOT).append(packages.get(i).charAt(0));
		}
		result.append(CharUtil.DOT).append(packages.get(size - 1));
		return result.toString();
	}
1223815
public static TypeDesc forClass(String name)
        throws IllegalArgumentException
    {
        // TODO: Figure out how to cache these. Using a plain IdentityMap poses
        // a problem. The back reference to the key causes a memory leak.

        if (name.length() < 1) {
            throw invalidName(name);
        }

        int index1 = name.lastIndexOf('[');
        int index2 = name.lastIndexOf(']');
        if (index2 >= 0) {
            if (index2 + 1 != name.length() || index1 + 1 != index2) {
                throw invalidName(name);
            }
            try {
                return forClass(name.substring(0, index1)).toArrayType();
            }
            catch (IllegalArgumentException e) {
                throw invalidName(name);
            }
        }
        else if (index1 >= 0) {
            throw invalidName(name);
        }

        switch (name.charAt(0)) {
        case 'v':
            if (name.equals("void")) {
                return VOID;
            }
            break;
        case 'b':
            if (name.equals("boolean")) {
                return BOOLEAN;
            }
            else if (name.equals("byte")) {
                return BYTE;
            }
            break;
        case 'c':
            if (name.equals("char")) {
                return CHAR;
            }
            break;
        case 's':
            if (name.equals("short")) {
                return SHORT;
            }
            break;
        case 'i':
            if (name.equals("int")) {
                return INT;
            }
            break;
        case 'l':
            if (name.equals("long")) {
                return LONG;
            }
            break;
        case 'f':
            if (name.equals("float")) {
                return FLOAT;
            }
            break;
        case 'd':
            if (name.equals("double")) {
                return DOUBLE;
            }
            break;
        }

        String desc = generateDescriptor(name);
        if (name.indexOf('/') >= 0) {
            name = name.replace('/', '.');
        }
        return intern(new ObjectType(desc, name));
    }
32477
public static String convertClassNameToUnderscoreName(String name) {
        StringBuilder result = new StringBuilder();

        if (name != null) {
            int len = name.length();

            if (len > 0) {
                result.append(name.charAt(0));

                for (int i = 1; i < len; i++) {
                    if (true == Character.isUpperCase(name.charAt(i))) {
                        result.append('_');
                    }

                    result.append(name.charAt(i));
                }
            }
        }

        return result.toString().toUpperCase();
    }
1366023
public static String toClassName(String str) {
	StringBuffer javaName = new StringBuffer();
	String[] arr = lucee.runtime.type.util.ListUtil.listToStringArray(str, '/');

	for (int i = 0; i < arr.length; i++) {
	    if (i == (arr.length - 1)) arr[i] = replaceLast(arr[i], '.', '$');
	    if (i != 0) javaName.append('.');
	    javaName.append(toVariableName(arr[i]));
	}
	return javaName.toString().toLowerCase();
    }
1268403
public Class getClassByName(String name)
	{

		if (name.indexOf(".") != -1)
		{
			try
			{
				return Class.forName(name,true,gt.getClassLoader());
			}
			catch (ClassNotFoundException e)
			{
				return null;
			}

		}
		else
		{
			Class cls = map.get(name);
			if (cls == null)
			{
				for (String pkg : pkgList)
				{
					try
					{
						String clsName = pkg.concat(name);
						cls = Class.forName(clsName,true,gt.getClassLoader());
						map.put(name, cls);
						return cls;

					}
					catch (Exception ex)
					{
						// continue;
					}
				}
				return null;
			}
			else
			{
				return cls;
			}

		}

	}
1358741
private String normalizeClassName(final Class<?> c) {
        if (Blob.class.isAssignableFrom(c)) return "java.sql.Blob";
        else if (Array.class.isAssignableFrom(c)) return "java.sql.Array";
        
        return c.getName();
    }
372265
public static String transformClassName(String className) {
        int lastDot = className.lastIndexOf('.');
        if (lastDot >= 0) {
            String pkg = className.substring(0, lastDot);
            if (!isUnlikelyToBeRenamed(pkg)) {
                className = className.substring(lastDot + 1);
            }
        }
        return className;
    }
890967
@Override
    public JavaClass findClass(/*@Nonnull*/ String className) {
        // Make sure we handle class names with slashes.
        // If we don't, we can get into serious trouble: a previously
        // loaded class will appear to be missing (because we're using the
        // wrong name to look it up) and be evicted by some other random
        // version of the class loaded from the classpath.
        String dottedClassName = className.replace('/', '.');

        return nameToClassMap.get(dottedClassName);
    }
877414
def class_to_array(class_name)
      class_name.to_s.split("::").map{ |m| m.gsub(/[A-Z]/) { |c| "_#{c}"}.gsub(/^_/,"").downcase }
    end
873058
@SuppressWarnings("rawtypes")
	public static String unqualifiedClassName(Class type) {
		if (type.isArray()) {
			return unqualifiedClassName(type.getComponentType()) + "Array";
		}
		String name = type.getName();
		return name.substring(name.lastIndexOf('.') + 1);
	}
208471
private static Class<?> getClassFromInternalName(String internalName) {
    try {
      return Class.forName(internalName.replace('/', '.'));
    } catch (ClassNotFoundException e) {
      throw new RuntimeException(e);
    }
  }
420912
public static String toClassName(final String type) {
        switch (type.charAt(0)) {
            case 'V':
                return CLASS_PRIMITIVE_VOID;
            case 'Z':
                return CLASS_PRIMITIVE_BOOLEAN;
            case 'C':
                return CLASS_PRIMITIVE_CHAR;
            case 'B':
                return CLASS_PRIMITIVE_BYTE;
            case 'S':
                return CLASS_PRIMITIVE_SHORT;
            case 'I':
                return CLASS_PRIMITIVE_INT;
            case 'F':
                return CLASS_PRIMITIVE_FLOAT;
            case 'J':
                return CLASS_PRIMITIVE_LONG;
            case 'D':
                return CLASS_PRIMITIVE_DOUBLE;
            case 'L':
                final int typeParamStart = type.indexOf('<');
                final int endIndex = typeParamStart >= 0 ? typeParamStart : type.indexOf(';');
                return type.substring(1, endIndex);
            case '[':
            case '+':
            case '-':
                return toClassName(type.substring(1));
            case 'T':
                // TODO handle type variables
                return CLASS_OBJECT;
            default:
                throw new IllegalArgumentException("Not a type signature: " + type);
        }
    }
583031
@Override
    public String fromClassNameToShortComponentName(final String className) {
        if (LdiStringUtil.isEmpty(className)) {
            throw new EmptyRuntimeException("className");
        }
        String s = LdiStringUtil.decapitalize(LdiClassUtil.getShortClassName(className));
        if (s.endsWith(implementationSuffix)) {
            return s.substring(0, s.length() - implementationSuffix.length());
        }
        return s;
    }
273123
def class_name_to_instant_name(name):
    
    name = name.replace('/', '_')
    ret = name[0].lower()
    for i in range(1, len(name)):
        if name[i] == '_':
            ret += '.'
        elif '9' < name[i] < 'a' and name[i - 1] != '_':
            ret += '_' + name[i].lower()
        else:
            ret += name[i].lower()
    return ret
120794
private String convertFileNameToBaseClassName(String filename) {
        if (filename.endsWith("_.java")) {
            return substringBeforeLast(filename, "_.java") + BASE_SUFFIX_;
        } else {
            return substringBeforeLast(filename, ".java") + BASE_SUFFIX;
        }
    }
1020845
function createClassName( className ) {
		return namespace + "-" + ((ieVersion == 6 && patchIE6MultipleClasses) ?
			ie6PatchID++
		:
			className.replace(RE_PATCH_CLASS_NAME_REPLACE, function(a) { return a.charCodeAt(0); }));
	}