Skip to content

Replace Collections.emptyXXX with Immutable Static Factory Methods #1044

@mkarg

Description

@mkarg

Replace

List<String> list = Collections.emptyList()
Map<String,String> map = Collections.emptyMap();
Set<String> set = Collections.emptySet();

With

List<String> list =  List.of()
Map<String,String> map = Map.of();
Set<String> set  = Set.of();

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions