mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 18:28:59 +03:00
spotbugs: Method does not presize the allocation of a collection
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
9a730d8c0b
commit
33d26c6322
2 changed files with 12 additions and 7 deletions
|
@ -109,11 +109,12 @@ public class SendFilesDialog extends BottomSheetDialogFragment {
|
|||
|
||||
@NonNull
|
||||
private List<SendButtonData> setupSendButtonData(Intent sendIntent) {
|
||||
List<SendButtonData> sendButtonDataList = new ArrayList<>();
|
||||
Drawable icon;
|
||||
SendButtonData sendButtonData;
|
||||
CharSequence label;
|
||||
for (ResolveInfo match : requireActivity().getPackageManager().queryIntentActivities(sendIntent, 0)) {
|
||||
List<ResolveInfo> matches = requireActivity().getPackageManager().queryIntentActivities(sendIntent, 0);
|
||||
List<SendButtonData> sendButtonDataList = new ArrayList<>(matches.size());
|
||||
for (ResolveInfo match : matches) {
|
||||
icon = match.loadIcon(requireActivity().getPackageManager());
|
||||
label = match.loadLabel(requireActivity().getPackageManager());
|
||||
sendButtonData = new SendButtonData(icon, label,
|
||||
|
|
|
@ -241,11 +241,15 @@ public class SendShareDialog extends BottomSheetDialogFragment {
|
|||
|
||||
@NonNull
|
||||
private List<SendButtonData> setupSendButtonData(Intent sendIntent) {
|
||||
List<SendButtonData> sendButtonDataList = new ArrayList<>();
|
||||
for (ResolveInfo match : getActivity().getPackageManager().queryIntentActivities(sendIntent, 0)) {
|
||||
Drawable icon = match.loadIcon(getActivity().getPackageManager());
|
||||
CharSequence label = match.loadLabel(getActivity().getPackageManager());
|
||||
SendButtonData sendButtonData = new SendButtonData(icon, label,
|
||||
Drawable icon;
|
||||
SendButtonData sendButtonData;
|
||||
CharSequence label;
|
||||
List<ResolveInfo> matches = requireActivity().getPackageManager().queryIntentActivities(sendIntent, 0);
|
||||
List<SendButtonData> sendButtonDataList = new ArrayList<>(matches.size());
|
||||
for (ResolveInfo match : matches) {
|
||||
icon = match.loadIcon(requireActivity().getPackageManager());
|
||||
label = match.loadLabel(requireActivity().getPackageManager());
|
||||
sendButtonData = new SendButtonData(icon, label,
|
||||
match.activityInfo.packageName,
|
||||
match.activityInfo.name);
|
||||
|
||||
|
|
Loading…
Reference in a new issue