@SuppressWarnings("all")
	public static boolean isValidDesc(@Nullable String desc) {
		if (desc == null)
			return false;
		if (desc.length() == 0)
			return false;
		char first = desc.charAt(0);
		if (first == '(') {
			try {
				Type methodType = Type.getMethodType(desc);
				methodType.getArgumentTypes();
				methodType.getReturnType();
				return true;
			} catch (Throwable t) {
				return false;
			}
		} else if (first == 'L' || first == '[') {
			try {
				Type type = Type.getType(desc);
				if (type.getSort() == Type.OBJECT && !desc.endsWith(";"))
					return false;
				else if (type.getSort() == Type.ARRAY && type.getElementType() == null)
					return false;
				return true;
			} catch (Throwable t) {
				return false;
			}
		}
		return false;
	}
@Test
	void testIsValidDesc() {
		assertTrue(Types.isValidDesc("([I[[J[[I)V"), "method desc");
		assertTrue(Types.isValidDesc("[I"), "array desc");
		assertTrue(Types.isValidDesc("Ljava/lang/String;"), "object desc");
		//
		assertTrue(Types.isValidDesc("LLLLj/av/a/la/ng/S/t/ri/n/g;"), "ugly but valid");
		assertTrue(Types.isValidDesc("L\0;"), "null-terminator is valid");
		assertTrue(Types.isValidDesc("L\n;"), "newline is valid");
		assertTrue(Types.isValidDesc("L;"), "empty is valid");
		//
		assertFalse(Types.isValidDesc(null), "null is invalid");
		assertFalse(Types.isValidDesc(""), "empty string is invalid");
		assertFalse(Types.isValidDesc("["), "array without type is invalid");
		assertFalse(Types.isValidDesc("[P"), "array without valid type is invalid");
		assertFalse(Types.isValidDesc("java/lang/String"), "internal name is invalid");
		assertFalse(Types.isValidDesc("(L;;)V"), "double ;; is unresolvable in method desc args");
	}