The first one is the superclass, the others are interfaces
()
| 716 | * The first one is the superclass, the others are interfaces |
| 717 | **/ |
| 718 | private String[] getGenericTypeSignatures() { |
| 719 | String signature = Classes.toString((byte[]) vmClass.addendum.signature); |
| 720 | final char[] signChars = signature.toCharArray(); |
| 721 | |
| 722 | // Addendum format: |
| 723 | // <generic args if present>LBaseClass;LIface1;LIface2;... |
| 724 | // We should split it |
| 725 | |
| 726 | int i = -1; |
| 727 | |
| 728 | // Passing the generic args |
| 729 | int angles = 0; |
| 730 | do { |
| 731 | i++; |
| 732 | if (signChars[i] == '<') angles ++; |
| 733 | else if (signChars[i] == '>') angles --; |
| 734 | } while (angles > 0); |
| 735 | if (signChars[i] == '>') i++; |
| 736 | |
| 737 | // Splitting types list |
| 738 | LinkedList<String> typeSigns = new LinkedList<String>(); |
| 739 | StringBuilder curTypeSign = new StringBuilder(); |
| 740 | for (; i < signChars.length; i++) { |
| 741 | // Counting braces |
| 742 | if (signChars[i] == '<') angles ++; |
| 743 | else if (signChars[i] == '>') angles --; |
| 744 | |
| 745 | // Appending character |
| 746 | curTypeSign.append(signChars[i]); |
| 747 | |
| 748 | // Splitting |
| 749 | if (angles == 0 && signChars[i] == ';') { |
| 750 | typeSigns.add(curTypeSign.toString()); |
| 751 | curTypeSign.setLength(0); |
| 752 | } |
| 753 | } |
| 754 | if (curTypeSign.length() > 0) typeSigns.add(curTypeSign.toString()); |
| 755 | |
| 756 | String[] res = new String[typeSigns.size()]; |
| 757 | return typeSigns.toArray(res); |
| 758 | } |
| 759 | |
| 760 | public Type[] getGenericInterfaces() { |
| 761 | if (vmClass.addendum == null || vmClass.addendum.signature == null) { |