【Android Studio3.5】Potential heap pollution via varargs parameter key

Scenario : When importing the github code, the various dependent versions were changed first. After successful import, the title problem appeared when it was run on the emulator. After checking, the cause was heap pollution caused by Java generic conversion. Since this problem is no longer caused by the code written by myself, it is a mature and stable open source code downloaded, so the solution is as follows. If this problem occurs in the code written by myself, please do not refer to it.

Solution : Check the log to find the functions that cause heap pollution, and add comments:

@SafeVarargs

Insert image description here

@SuppressWarnings({"unchecked", "varargs"})

Insert image description here
problem solved

Guess you like

Origin blog.csdn.net/weixin_40934065/article/details/103499074