Commit 7f2c5bb6 authored by Eric Bruneton's avatar Eric Bruneton
Browse files

Restore bug fix, make previously added test pass.

parent 20755a36
......@@ -337,8 +337,20 @@ public class Type {
*/
public static Type getReturnType(final String methodDescriptor) {
final char[] valueBuffer = methodDescriptor.toCharArray();
int returnTypeOffset = methodDescriptor.indexOf(')') + 1;
return getType(valueBuffer, returnTypeOffset, valueBuffer.length - returnTypeOffset);
// Skip the first character, which is always a '('.
int currentOffset = 1;
// Skip the argument types, one at a each loop iteration.
while (valueBuffer[currentOffset] != ')') {
while (valueBuffer[currentOffset] == '[') {
currentOffset++;
}
if (valueBuffer[currentOffset++] == 'L') {
while (valueBuffer[currentOffset++] != ';') {
// Skip the argument descriptor content.
}
}
}
return getType(valueBuffer, currentOffset + 1, valueBuffer.length - currentOffset - 1);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment