Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
The
putStringArray
function inData.Builder
is declared asand therefore you can construct a
Data
instance containing an array withnull
s via e.g.this works and throws no exceptions. However, you can never retrieve the array because
getStringArray
inData
is defined asYou can cast the result to
Array<String?>?
to supress the type error, but then aNullPointerException
is thrown becausegetTypedArray
tries to cast every element to a (non-null)String
.Here is a basic JUnit Test for the issue: