Skip to content

Replace Collections.singletonXXX with Immutable Static Factory Methods #72

@yeikel

Description

@yeikel

This is similar to #67

Replace

List<String> list = Collections.singletonList("E")
Map<String,String> map = Collections.singletonMap("field3", "value3");
Set<String> set = Collections.singleton("Hello");

With

List<String> list =  List.of("e")
Map<String,String> map = Map.of"field3", "value3");
Set<String> set  = Set.of("Hello");

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions