Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#1,196 1 条评论 0 个 reaction 已指派 2 人 在 GitHub 查看

@rathovarun1032 已经在做这个了。

开始于 2026年3月15日。

评估

这个 Issue 还没有评估数据。

描述

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.

主要语言
Java
星标
620
派生
305
平均合并
4 天 9 小时
30 天内合并 PR
4

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/firebase-admin-java 的其他 Issue

查看 firebase/firebase-admin-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。