mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Spotbug: Method stores return result in local before immediately returning it
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
c5067b7a60
commit
f48575bfec
@ -38,6 +38,7 @@ import com.nextcloud.talk.models.json.participants.Participant;
|
|||||||
import com.nextcloud.talk.ui.theme.ViewThemeUtils;
|
import com.nextcloud.talk.ui.theme.ViewThemeUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import androidx.core.content.res.ResourcesCompat;
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
@ -171,10 +172,15 @@ public class ContactItem extends AbstractFlexibleItem<ContactItem.ContactItemVie
|
|||||||
if (!TextUtils.isEmpty(participant.getDisplayName())) {
|
if (!TextUtils.isEmpty(participant.getDisplayName())) {
|
||||||
displayName = participant.getDisplayName();
|
displayName = participant.getDisplayName();
|
||||||
} else {
|
} else {
|
||||||
displayName = NextcloudTalkApplication.Companion.getSharedApplication()
|
displayName = Objects.requireNonNull(NextcloudTalkApplication.Companion.getSharedApplication())
|
||||||
.getResources().getString(R.string.nc_guest);
|
.getResources().getString(R.string.nc_guest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// absolute fallback to prevent NPE deference
|
||||||
|
if (displayName == null) {
|
||||||
|
displayName = "Guest";
|
||||||
|
}
|
||||||
|
|
||||||
ImageViewExtensionsKt.loadAvatar(holder.binding.avatarView, user, displayName, true);
|
ImageViewExtensionsKt.loadAvatar(holder.binding.avatarView, user, displayName, true);
|
||||||
} else if (participant.getCalculatedActorType() == Participant.ActorType.USERS ||
|
} else if (participant.getCalculatedActorType() == Participant.ActorType.USERS ||
|
||||||
PARTICIPANT_SOURCE_USERS.equals(participant.getSource())) {
|
PARTICIPANT_SOURCE_USERS.equals(participant.getSource())) {
|
||||||
|
@ -73,8 +73,7 @@ public class NotificationSoundItem extends AbstractFlexibleItem<NotificationSoun
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int result = notificationSoundName != null ? notificationSoundName.hashCode() : 0;
|
int result = notificationSoundName != null ? notificationSoundName.hashCode() : 0;
|
||||||
result = 31 * result + (notificationSoundUri != null ? notificationSoundUri.hashCode() : 0);
|
return 31 * result + (notificationSoundUri != null ? notificationSoundUri.hashCode() : 0);
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -74,8 +74,7 @@ public class DavResponse {
|
|||||||
final Object $response = this.getResponse();
|
final Object $response = this.getResponse();
|
||||||
result = result * PRIME + ($response == null ? 43 : $response.hashCode());
|
result = result * PRIME + ($response == null ? 43 : $response.hashCode());
|
||||||
final Object $data = this.getData();
|
final Object $data = this.getData();
|
||||||
result = result * PRIME + ($data == null ? 43 : $data.hashCode());
|
return result * PRIME + ($data == null ? 43 : $data.hashCode());
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -249,9 +249,7 @@ public class RestModule {
|
|||||||
.method(original.method(), original.body())
|
.method(original.method(), original.body())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Response response = chain.proceed(request);
|
return chain.proceed(request);
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,8 +89,7 @@ public class EventStatus {
|
|||||||
result = result * PRIME + (int) ($userId >>> 32 ^ $userId);
|
result = result * PRIME + (int) ($userId >>> 32 ^ $userId);
|
||||||
final Object $eventType = this.getEventType();
|
final Object $eventType = this.getEventType();
|
||||||
result = result * PRIME + ($eventType == null ? 43 : $eventType.hashCode());
|
result = result * PRIME + ($eventType == null ? 43 : $eventType.hashCode());
|
||||||
result = result * PRIME + (this.isAllGood() ? 79 : 97);
|
return result * PRIME + (this.isAllGood() ? 79 : 97);
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -58,8 +58,7 @@ public class MoreMenuClickEvent {
|
|||||||
final int PRIME = 59;
|
final int PRIME = 59;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
final Object $conversation = this.getConversation();
|
final Object $conversation = this.getConversation();
|
||||||
result = result * PRIME + ($conversation == null ? 43 : $conversation.hashCode());
|
return result * PRIME + ($conversation == null ? 43 : $conversation.hashCode());
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -56,8 +56,7 @@ public class NetworkEvent {
|
|||||||
final int PRIME = 59;
|
final int PRIME = 59;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
final Object $networkConnectionEvent = this.getNetworkConnectionEvent();
|
final Object $networkConnectionEvent = this.getNetworkConnectionEvent();
|
||||||
result = result * PRIME + ($networkConnectionEvent == null ? 43 : $networkConnectionEvent.hashCode());
|
return result * PRIME + ($networkConnectionEvent == null ? 43 : $networkConnectionEvent.hashCode());
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -56,8 +56,7 @@ public class UserMentionClickEvent {
|
|||||||
final int PRIME = 59;
|
final int PRIME = 59;
|
||||||
int result = 1;
|
int result = 1;
|
||||||
final Object $userId = this.getUserId();
|
final Object $userId = this.getUserId();
|
||||||
result = result * PRIME + ($userId == null ? 43 : $userId.hashCode());
|
return result * PRIME + ($userId == null ? 43 : $userId.hashCode());
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -75,8 +75,7 @@ public class WebSocketCommunicationEvent {
|
|||||||
final Object $type = this.getType();
|
final Object $type = this.getType();
|
||||||
result = result * PRIME + ($type == null ? 43 : $type.hashCode());
|
result = result * PRIME + ($type == null ? 43 : $type.hashCode());
|
||||||
final Object $hashMap = this.getHashMap();
|
final Object $hashMap = this.getHashMap();
|
||||||
result = result * PRIME + ($hashMap == null ? 43 : $hashMap.hashCode());
|
return result * PRIME + ($hashMap == null ? 43 : $hashMap.hashCode());
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -98,8 +98,7 @@ public class ImportAccount {
|
|||||||
final Object $token = this.getToken();
|
final Object $token = this.getToken();
|
||||||
result = result * PRIME + ($token == null ? 43 : $token.hashCode());
|
result = result * PRIME + ($token == null ? 43 : $token.hashCode());
|
||||||
final Object $baseUrl = this.getBaseUrl();
|
final Object $baseUrl = this.getBaseUrl();
|
||||||
result = result * PRIME + ($baseUrl == null ? 43 : $baseUrl.hashCode());
|
return result * PRIME + ($baseUrl == null ? 43 : $baseUrl.hashCode());
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -87,13 +87,11 @@ public class Spans {
|
|||||||
final Object $id = this.getId();
|
final Object $id = this.getId();
|
||||||
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
|
result = result * PRIME + ($id == null ? 43 : $id.hashCode());
|
||||||
final Object $label = this.getLabel();
|
final Object $label = this.getLabel();
|
||||||
result = result * PRIME + ($label == null ? 43 : $label.hashCode());
|
return result * PRIME + ($label == null ? 43 : $label.hashCode());
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Spans.MentionChipSpan(id=" + this.getId() + ", label=" + this.getLabel() + ")";
|
return "Spans.MentionChipSpan(id=" + this.getId() + ", label=" + this.getLabel() + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user