mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 23:25:20 +03:00
Spotbugs: precize allocation of a collection
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
698ebdfd1c
commit
7a4785e083
3 changed files with 4 additions and 3 deletions
|
@ -74,7 +74,7 @@ public class DavUtils {
|
|||
public static final String PROPERTY_QUOTA_AVAILABLE_BYTES = "quota-available-bytes";
|
||||
|
||||
static Property.Name[] getAllPropSet() {
|
||||
List<Property.Name> props = new ArrayList<>();
|
||||
List<Property.Name> props = new ArrayList<>(20);
|
||||
|
||||
props.add(DisplayName.NAME);
|
||||
props.add(GetContentType.NAME);
|
||||
|
|
|
@ -69,7 +69,6 @@ public class ReadFilesystemOperation {
|
|||
DavResponse davResponse = new DavResponse();
|
||||
final List<Response> memberElements = new ArrayList<>();
|
||||
final Response[] rootElement = new Response[1];
|
||||
final List<BrowserFile> remoteFiles = new ArrayList<>();
|
||||
|
||||
try {
|
||||
new DavResource(okHttpClient, HttpUrl.parse(url)).propfind(depth, DavUtils.getAllPropSet(),
|
||||
|
@ -94,6 +93,7 @@ public class ReadFilesystemOperation {
|
|||
Log.w(TAG, "Error reading remote path");
|
||||
}
|
||||
|
||||
final List<BrowserFile> remoteFiles = new ArrayList<>(1 + memberElements.size());
|
||||
remoteFiles.add(BrowserFile.Companion.getModelFromResponse(rootElement[0],
|
||||
rootElement[0].getHref().toString().substring(basePath.length())));
|
||||
for (Response memberElement : memberElements) {
|
||||
|
|
|
@ -147,7 +147,8 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
|||
if (mentionsList.size() == 0) {
|
||||
adapter.clear();
|
||||
} else {
|
||||
List<AbstractFlexibleItem> internalAbstractFlexibleItemList = new ArrayList<>();
|
||||
List<AbstractFlexibleItem> internalAbstractFlexibleItemList =
|
||||
new ArrayList<>(mentionsList.size());
|
||||
for (Mention mention : mentionsList) {
|
||||
internalAbstractFlexibleItemList.add(
|
||||
new MentionAutocompleteItem(
|
||||
|
|
Loading…
Reference in a new issue