Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-39056

Use `Collections.singletonList` instead of `Arrays.asList` when there is only one argument

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 3.4.0
    • None
    • Spark Core, SQL
    • None

    Description

      Use `Collections.singletonList` instead of `Arrays.asList` when there is only one argument.

       

      before

      List<String> one = Arrays.asList("one"); 

      after

      List<String> one = Collections.singletonList("one"); 

      Attachments

        Activity

          People

            Unassigned Unassigned
            LuciferYang Yang Jie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: