Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

chore: demonstration of null calendar after reserialization of ImpersonatedCredentials - #1772

Closed
diegomarquezp wants to merge 1 commit into
mainfrom
b/416096444
Closed

diegomarquezp wants to merge 1 commit into
mainfrom
b/416096444

Conversation

@diegomarquezp

@diegomarquezp diegomarquezp commented Jun 9, 2025 •

Copy link
Copy Markdown
Contributor

b/416096444

This test fails with:

java.lang.NullPointerException: Cannot invoke "java.util.Calendar.getDisplayNames(int, int, java.util.Locale)" because "this.calendar" is null

	at java.base/java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1980)
	at java.base/java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1545)
	at java.base/java.text.DateFormat.parse(DateFormat.java:397)
	at com.google.auth.oauth2.ImpersonatedCredentials.refreshAccessToken(ImpersonatedCredentials.java:579)
	at com.google.auth.oauth2.ImpersonatedCredentialsTest.refreshAccessToken_reserialized_success(ImpersonatedCredentialsTest.java:544)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

This is due to this.calendar marked as transient:

We must understand the reasons for:

  • Including the calendar in the credentials object (instead of maybe using UTC, as pointed out by @lqiu96)
  • Marking the calendar as transient

@diegomarquezp diegomarquezp added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jun 9, 2025
@product-auto-label product-auto-label Bot added the size: s Pull request size is small. label Jun 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant