Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8068887

java.lang.Throwable could use Collections.emptyList for suppressedException

    Details

    • Subcomponent:
    • Resolved In Build:
      b89
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Currently this is used as a default value for suppressedException:

            // Setting this static field introduces an acceptable
            // initialization dependency on a few java.util classes.
            private static final List<Throwable> SUPPRESSED_SENTINEL =
                Collections.unmodifiableList(new ArrayList<Throwable>(0));

        Substituting Collections.unmodifiableList(new ArrayList<Throwable>(0)) with Collections.emptyList() indicate 3 fewer classes are loaded in a hello world program, and thus a very small startup footprint improvement.

        emptyList should be providing the same immutability and identity requirements.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  vtewari Vyom Tewari
                  Reporter:
                  redestad Claes Redestad
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: