Fix Utils.isDoubleSlot, 'L' should be 'D'.

This commit is contained in:
liuzhengyang
2019-09-29 18:15:50 +08:00
parent 59b32f957a
commit 746732a9fc
2 changed files with 8 additions and 1 deletions

View File

@@ -1016,7 +1016,7 @@ public class Utils implements Opcodes, Constants {
public boolean isDoubleSlot() {
if (kind == Kind.PRIMITIVE) {
char ch = descriptor.charAt(0);
return ch == 'J' || ch == 'L';
return ch == 'J' || ch == 'D';
}
return false;
}

View File

@@ -564,6 +564,13 @@ public class ReloadableTypeTests extends SpringLoadedTests {
assertFalse(rt.isDoubleSlot());
assertFalse(rt.isVoid());
rt = ReturnType.getReturnType("D");
assertEquals(ReturnType.Kind.PRIMITIVE, rt.kind);
assertEquals("D", rt.descriptor);
assertTrue(rt.isPrimitive());
assertTrue(rt.isDoubleSlot());
assertFalse(rt.isVoid());
rt = ReturnType.getReturnType("[Ljava/lang/String;");
assertEquals(ReturnType.Kind.ARRAY, rt.kind);
assertEquals("[Ljava/lang/String;", rt.descriptor);