MCPcopy Create free account
hub / github.com/ReadyTalk/avian / getGenericTypeSignatures

Method getGenericTypeSignatures

classpath/java/lang/Class.java:718–758  ·  view source on GitHub ↗

The first one is the superclass, the others are interfaces

()

Source from the content-addressed store, hash-verified

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) {

Callers 2

getGenericInterfacesMethod · 0.95
getGenericSuperclassMethod · 0.95

Calls 9

toStringMethod · 0.95
toCharArrayMethod · 0.95
appendMethod · 0.95
addMethod · 0.95
toStringMethod · 0.95
setLengthMethod · 0.95
lengthMethod · 0.95
sizeMethod · 0.95
toArrayMethod · 0.65

Tested by

no test coverage detected