Skip to content

Infinite recursion in KotlinDetector.hasSerializableAnnotation #37127

Closed as not planned

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))
        );
    }
}

Activity

  1. bclozel commented on Aug 11, 2026

    @bclozel
    Member

    Superseded by #37128

  2. added
    status: supersededAn issue that has been superseded by another
    and removed on Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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