Skip to content

Commit

Permalink
Fix interface edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeHegarty committed Apr 3, 2018
1 parent 615e54c commit c062da8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,8 @@ public Type[] apply(final int s)
continued.name = (countUses == null) ? continuedName : (continuedName + "$" + countUses);
continued.desc = Type.getMethodDescriptor(COMPLETABLE_FUTURE_TYPE, typeArguments);
continued.signature = null;
final Handle handle = new Handle(Opcodes.H_INVOKESTATIC, classNode.name, continued.name, continued.desc);
final boolean isInterface = (classNode.access & ACC_INTERFACE) == ACC_INTERFACE;
final Handle handle = new Handle(Opcodes.H_INVOKESTATIC, classNode.name, continued.name, continued.desc, isInterface);

final boolean nonCompFutReturn = !original.desc.endsWith(COMPLETABLE_FUTURE_RET) && !original.desc.endsWith(COMPLETION_STAGE_RET);

Expand Down Expand Up @@ -1153,7 +1154,8 @@ private void transformAwait(
final String retType = Type.getReturnType(original.desc).getInternalName();
final String castFunction = "lambda$checkCast$" + retType.replace('/', '_');
generateCheckCast(classNode, castFunction, retType);
mv.visitMethodInsn(INVOKESTATIC, classNode.name, castFunction, "(Ljava/util/concurrent/CompletionStage;)L" + retType + ";", false);
final boolean isInterface = (classNode.access & ACC_INTERFACE) == ACC_INTERFACE;
mv.visitMethodInsn(INVOKESTATIC, classNode.name, castFunction, "(Ljava/util/concurrent/CompletionStage;)L" + retType + ";", isInterface);
mv.visitTypeInsn(CHECKCAST, retType);


Expand Down

0 comments on commit c062da8

Please sign in to comment.