Spotbugs: precize allocation of a collection

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-12-28 10:42:49 +01:00
parent 698ebdfd1c
commit 7a4785e083
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 4 additions and 3 deletions

View file

@ -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);

View file

@ -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) {

View file

@ -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(