Skip to content

Infinite recursion in KotlinDetector.hasSerializableAnnotation #37127

Description

KotlinDetector.hasSerializableAnnotation goes into infinite recursion when fed a self-referential generic type such as Guava's ImmutableEnumSet. Minimal reproducing example:

import com.google.common.collect.Sets;
import org.springframework.core.KotlinDetector;
import org.springframework.core.ResolvableType;

public class KotlinDetectorReproducer {

    enum Foo {
        BAR,
        BAZ, // Makes sure that `immutableEnumSet` doesn't produce a singleton set object
    }

    public static void main(String[] args) {
        KotlinDetector.hasSerializableAnnotation(
                ResolvableType.forInstance(Sets.immutableEnumSet(Foo.BAR, Foo.BAZ))
        );
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions