static Object[] signatureToTypes(String sig) {
            boolean hasParameters = sig.charAt(1) != ')';
            if (hasParameters) {
                List<Type> l = new ArrayList<>();
                int i = 1;
                boolean hasAnyAnglies = sig.indexOf('<') != -1;
                while (true) {
                    char c = sig.charAt(i);
                    if (c == ')') {
                        break;
                    }
                    int start = i;
                    while (c == '[') {
                        c = sig.charAt(++i);
                    }
                    if (c == 'L' || c == 'P') {
                        int nextSemicolon = sig.indexOf(';', start);
                        int firstAngly = (hasAnyAnglies ? sig.indexOf('<', start) : -1);
                        if (!hasAnyAnglies || firstAngly == -1 || firstAngly > nextSemicolon) {
                            i = nextSemicolon + 1;
                            l.add(Type.forSignature(sig.substring(start, i)));
                        } else {
                            boolean endOfSigReached = false;
                            int posn = firstAngly;
                            int genericDepth = 0;
                            while (!endOfSigReached) {
                                switch (sig.charAt(posn)) {
                                    case '<':
                                        genericDepth++;
                                        break;
                                    case '>':
                                        genericDepth--;
                                        break;
                                    case ';':
                                        if (genericDepth == 0) {
                                            endOfSigReached = true;
                                        }
                                        break;
                                    default:
                                }
                                posn++;
                            }
                            i = posn;
                            l.add(Type.forSignature(sig.substring(start, i)));
                        }
                    } else {
                        i++;
                        l.add(Type.forSignature(sig.substring(start, i)));
                    }
                }
                Type[] paramTypes = l.toArray(new Type[l.size()]);
                Type returnType = Type.forSignature(sig.substring(i + 1, sig.length()));
                return new Object[]{returnType, paramTypes};
            } else {
                Type returnType = Type.forSignature(sig.substring(2));
                return new Object[]{returnType, Type.NONE};
            }
        }
This is a parser for custom aop pointcut expression.
<p>
Such as <pre>int android.util.Log.d(java.lang.String,java.lang.String)</pre>
plugin/src/main/groovy/com/didichuxing/tools/droidassist/spec/SourceSpec.java