Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

[BUG] RemoteConfig unit tests fail in non-English (e.g., Korean) Locales due to Date Parsing

Offen
#1,196 1 Kommentar 0 Reaktionen 2 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 4 Tagen

@rathovarun1032 arbeitet bereits daran.

Seit 15.3.2026.

  • #1199 von @jungsehui — offen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

api: remoteconfig
[REQUIRED] Step 2: Describe your environment
  • Operating System version: macOS (Apple Silicon, ko_KR locale)
  • Firebase SDK version: 9.7.0 (Current development branch)
  • Library version: N/A
  • Firebase Product: Remote Config
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:

The unit tests for Remote Config fail when the system's default locale is set to a non-English language (e.g., Korean). This is due to RemoteConfigUtil using SimpleDateFormat without an explicit Locale.ENGLISH, causing parsing errors or string comparison mismatches against English date formats.

Error Output:
org.junit.ComparisonFailure: expected:<...NODE","updateTime":"[Tue, 08 Dec] 2020 15:49:51 UTC",...> 
but was:<...NODE","updateTime":"[화, 08 12월] 2020 15:49:51 UTC",...>

Caused by: java.text.ParseException: Unparseable date: "Tue, 08 Dec 2020 15:49:51 UTC"
    at java.base/java.text.DateFormat.parse(DateFormat.java:427)
    at com.google.firebase.remoteconfig.RemoteConfigUtil.convertFromUtcDateFormat(RemoteConfigUtil.java:91)
Relevant Code:

The issue occurs in RemoteConfigUtil.java. There are 4 methods using SimpleDateFormat without an explicit Locale. To ensure consistent behavior across different system locales, all instances of SimpleDateFormat should be instantiated with Locale.ENGLISH.

Affected Methods:

  • convertToUtcZuluFormat(long millis)
  • convertToUtcDateFormat(long millis)
  • convertFromUtcZuluFormat(String dateString)
  • convertFromUtcDateFormat(String dateString)

Current implementation:

SimpleDateFormat dateFormat = new SimpleDateFormat(PATTERN);

Recommended fix:

SimpleDateFormat dateFormat = new SimpleDateFormat(PATTERN, Locale.ENGLISH);

I've already identified the fix and verified it locally by setting the locale to Korean. I'd like to submit a Pull Request to resolve this issue.

Vorherrschende Sprache
Java
Sterne
620
Forks
306
Ø Merge
4 T. 7 Std.
Gemergte PRs (30 T.)
13

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus firebase/firebase-admin-java

Alle Issues in firebase/firebase-admin-java

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.