Skip to content

8361717: Refactor Collections.emptyList() in Locale related classes #26225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public record LanguageTag(String language, String script, String region, String
public static final String UNDETERMINED = "und";
public static final String PRIVUSE_VARIANT_PREFIX = "lvariant";
private static final String EMPTY_SUBTAG = "";
private static final List<String> EMPTY_SUBTAGS = Collections.emptyList();
private static final List<String> EMPTY_SUBTAGS = List.of();

// Map contains legacy language tags and its preferred mappings from
// http://www.ietf.org/rfc/rfc5646.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,7 +27,6 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.IllformedLocaleException;
import java.util.List;
Expand Down Expand Up @@ -388,8 +387,7 @@ static Locale getLookupLocale(Locale locale) {
* A dummy locale service provider list that indicates there is no
* provider available
*/
private static final List<LocaleServiceProvider> NULL_LIST =
Collections.emptyList();
private static final List<LocaleServiceProvider> NULL_LIST = List.of();

/**
* An interface to get a localized object for each locale sensitive
Expand Down