Skip to content

Commit

Permalink
Merge pull request #225 from FasterXML/tatu/2.16/223-fix-default-sett…
Browse files Browse the repository at this point in the history
…er-call

Fix #223: apply check for default (interface) method in all applicable locations
  • Loading branch information
cowtowncoder authored Oct 24, 2023
2 parents a1744ad + 2fe5bdd commit 4d11894
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ private <T extends OptimizedSettableBeanProperty<T>> void _addSettersUsingIf(Met
// to fix [Issue-5] (don't assume return type is 'void'), we need to:
Type returnType = Type.getType(method.getReturnType());

boolean isInterface = method.getDeclaringClass().isInterface();
boolean isInterface = isInterfaceMethod(method);
mv.visitMethodInsn(isInterface ? INVOKEINTERFACE : INVOKEVIRTUAL,
beanClassName, method.getName(), "("+type+")"+returnType, isInterface);
mv.visitInsn(RETURN);
Expand All @@ -318,7 +318,7 @@ private <T extends OptimizedSettableBeanProperty<T>> void _addSettersUsingIf(Met
if (mustCast) {
mv.visitTypeInsn(CHECKCAST, type.getInternalName());
}
isInterface = method.getDeclaringClass().isInterface();
isInterface = isInterfaceMethod(method);
mv.visitMethodInsn(isInterface ? INVOKEINTERFACE : INVOKEVIRTUAL,
beanClassName, method.getName(), "("+type+")"+returnType, isInterface);
mv.visitInsn(RETURN);
Expand Down Expand Up @@ -348,7 +348,7 @@ private <T extends OptimizedSettableBeanProperty<T>> void _addSettersUsingSwitch
if (mustCast) {
mv.visitTypeInsn(CHECKCAST, type.getInternalName());
}
boolean isInterface = method.getDeclaringClass().isInterface();
boolean isInterface = isInterfaceMethod(method);
mv.visitMethodInsn(isInterface ? INVOKEINTERFACE : INVOKEVIRTUAL,
beanClassName, method.getName(), "("+type+")"+returnType, isInterface);
mv.visitInsn(RETURN);
Expand Down
4 changes: 4 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Active maintainers:
=== Releases ===
------------------------------------------------------------------------

#223: IncompatibleClassChangeError when deserializing a class implementing
an interface with default get/set implementations
(reported by @avnersin)

2.16.0-rc1 (20-Oct-2023)

#181: (blackbird) BlackBird proxy object error in Java 17
Expand Down

0 comments on commit 4d11894

Please sign in to comment.