Extract class name from canonical Java class name

@param canonicalJavaClassName canonical class name (like 'a.b.c.SomeClassName'), must not be null
@return extracted class name, must not be null but can be empty for case "a.b.c.d."
190117
@Nonnull
  public static String extractClassName(@Nonnull final String canonicalJavaClassName) {
    final int lastDot = canonicalJavaClassName.lastIndexOf('.');
    if (lastDot < 0) {
      return canonicalJavaClassName.trim();
    }
    return canonicalJavaClassName.substring(lastDot + 1).trim();
  }
1236021
private static String getClassName(Class<?> clazz) {
		String name = clazz.getSimpleName();
		int dotPos = name.lastIndexOf('.');
		return dotPos==-1 ? name : name.substring(dotPos+1);
	}
352504
private static String toCanonicalName(String className) {
        className = StringUtils.deleteWhitespace(className);
        Validate.notNull(className, "className must not be null.");
        if (className.endsWith("[]")) {
            final StringBuilder classNameBuffer = new StringBuilder();
            while (className.endsWith("[]")) {
                className = className.substring(0, className.length() - 2);
                classNameBuffer.append("[");
            }
            final String abbreviation = abbreviationMap.get(className);
            if (abbreviation != null) {
                classNameBuffer.append(abbreviation);
            } else {
                classNameBuffer.append("L").append(className).append(";");
            }
            className = classNameBuffer.toString();
        }
        return className;
    }
680135
public static String extractPackage(String classname) {
    if (classname.contains("."))
      return classname.substring(0, classname.lastIndexOf("."));
    else
      return DEFAULT_PACKAGE;
  }
510368
public static String getClassName(String key) {
    int start = 0;
    if (key.startsWith("@") || key.startsWith("members/")) {
      start = key.lastIndexOf('/') + 1;
    }
    return (key.indexOf('<', start) == -1 && key.indexOf('[', start) == -1)
        ? key.substring(start)
        : null;
  }
298693
public String getFullyQualifiedNameForClassName(String className) {
    if (!classNameToFullyQualifiedName.containsKey(className)) {
      return className;
    }

    return classNameToFullyQualifiedName.get(className);
  }
340805
public static Class extractClass(Type javaType) {
        if (javaType instanceof ParameterizedType
                && ((ParameterizedType)javaType).getRawType() instanceof Class){
            return (Class)((ParameterizedType)javaType).getRawType();
        }  else if (javaType instanceof GenericArrayType) {
            return Object[].class;
        }  else if (javaType instanceof Class) {
            return (Class)javaType;
        }

        throw new JaversException(JaversExceptionCode.CLASS_EXTRACTION_ERROR, javaType);
    }
450377
def extract_canonical(bs4):
    

    link_rel = bs4.select('link[rel="canonical"]')

    if link_rel.__len__() > 0:

        if link_rel[0].has_attr('href'):

            return link_rel[0]['href']

    return None
1315788
@Override
  public String extractClassNameIfRequire(Node node, Node parent) {
    return extractClassNameIfGoog(node, parent, "goog.require");
  }
863937
private static String getClassFromDeclarationName(String fullDeclarationName) {
    String[] parts = fullDeclarationName.split("\\.prototype\\.");
    checkState(parts.length == 1 || parts.length == 2);
    if (parts.length == 2) {
      return parts[0];
    }
    return null;
  }
1163512
private static List<String> extractClassNames(String jarName) throws IOException {
        List<String> classes = new LinkedList<String>();
        ZipInputStream orig = new ZipInputStream(new FileInputStream(jarName));
        for (ZipEntry entry = orig.getNextEntry(); entry != null; entry = orig.getNextEntry()) {
            String fullName = entry.getName().replaceAll("/", ".").replace(".class", "");
            classes.add(fullName);
        }
        orig.close();
        return classes;
    }
557008
public JClass forName(String name)
  {
    SoftReference<JClass> jClassRef = _classMap.get(name);

    JClass jClass = jClassRef != null ? jClassRef.get() : null;

    if (jClass == null) {
      jClass = _staticClassMap.get(name);

      if (jClass == null) {
        if (name.startsWith("[")) {
          JClass subClass = descriptorToClass(name, 1);
          jClass = new JClassArray(subClass);
        }
        else
          jClass = loadClass(name);
      }
      
      _classMap.put(name, new SoftReference<JClass>(jClass));
    }

    return jClass;
  }
1335254
public static String getShortCanonicalName(final Class<?> cls) {
        if (cls == null) {
            return StringUtils.EMPTY;
        }
        return getShortCanonicalName(cls.getName());
    }
921120
public static final String extractPackageName(String className) {
		if (className == null || className.trim().isEmpty()) {
			return "";
		}
		
		final int idx = className.lastIndexOf('.');
		if (idx == -1) {
			return "";
		} else {
			return className.substring(0, idx);
		}
	}
17092
public static String extractAsClassName(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attributeName) {
		final Elements elementUtils=BindDataSourceSubProcessor.elementUtils;
		final One<String> result = new One<String>();

		extractString(elementUtils, item, annotationClass, attributeName, new OnAttributeFoundListener() {

			@Override
			public void onFound(String value) {
				result.value0 = AnnotationUtility.extractAsArrayOfClassName(value).get(0);
			}
		});

		return result.value0;
	}
864651
public static String getDomainName(String className)
   {
	   int i = className.indexOf('.');
	   i = className.indexOf('.', i + 1);
	   if (i == -1)
		   return null;
	   return className.substring(0, i);
   }
176549
public static String getClassName(String sourceCode) {
		int index = sourceCode.indexOf(" class ");
		int lastIndex = sourceCode.indexOf("{");
		String className = sourceCode.substring(index + 6, lastIndex).trim();
		return className;
	}