diff --git a/src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java b/src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java index b5c3f39d47d..13d4aa45121 100644 --- a/src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java +++ b/src/main/java/com/fasterxml/jackson/databind/introspect/AnnotatedCreatorCollector.java @@ -277,10 +277,19 @@ private List _findPotentialFactories(TypeFactory typeFactory, private static boolean _isIncludableFactoryMethod(Method m) { - return Modifier.isStatic(m.getModifiers()) - // 09-Nov-2020, ckozak: Avoid considering synthetic methods such as - // lambdas used within methods because they're not relevant. - && !m.isSynthetic(); + if (!Modifier.isStatic(m.getModifiers())) { + return false; + } + + boolean isSynthetic = m.isSynthetic(); + boolean kotlinValueClassFactory = isSynthetic && m.getName().equals("box-impl"); + if (kotlinValueClassFactory) { + return true; + } + + // 09-Nov-2020, ckozak: Avoid considering synthetic methods such as + // lambdas used within methods because they're not relevant. + return !isSynthetic; } protected AnnotatedConstructor constructDefaultConstructor(ClassUtil.Ctor ctor,