mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 07:05:49 +03:00
codacy: Avoid declaring a variable if it is unreferenced before a possible exit point.
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
cd1469317d
commit
2c55f2ee49
1 changed files with 9 additions and 10 deletions
|
@ -160,8 +160,6 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
|
|||
}
|
||||
|
||||
private Cursor searchForUsersOrGroups(Uri uri) {
|
||||
MatrixCursor response = null;
|
||||
|
||||
String lastPathSegment = uri.getLastPathSegment();
|
||||
|
||||
if (lastPathSegment == null) {
|
||||
|
@ -192,20 +190,15 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
|
|||
showErrorMessage(result);
|
||||
}
|
||||
|
||||
MatrixCursor response = null;
|
||||
// convert the responses from the OC server to the expected format
|
||||
if (names.size() > 0) {
|
||||
response = new MatrixCursor(COLUMNS);
|
||||
Iterator<JSONObject> namesIt = names.iterator();
|
||||
JSONObject item;
|
||||
String displayName;
|
||||
int icon = 0;
|
||||
Uri dataUri;
|
||||
int count = 0;
|
||||
|
||||
if (getContext() == null) {
|
||||
throw new IllegalArgumentException("Context may not be null!");
|
||||
}
|
||||
|
||||
response = new MatrixCursor(COLUMNS);
|
||||
|
||||
Uri userBaseUri = new Uri.Builder().scheme(CONTENT).authority(DATA_USER).build();
|
||||
Uri groupBaseUri = new Uri.Builder().scheme(CONTENT).authority(DATA_GROUP).build();
|
||||
Uri roomBaseUri = new Uri.Builder().scheme(CONTENT).authority(DATA_ROOM).build();
|
||||
|
@ -217,6 +210,12 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
|
|||
.isTrue();
|
||||
|
||||
try {
|
||||
Iterator<JSONObject> namesIt = names.iterator();
|
||||
JSONObject item;
|
||||
String displayName;
|
||||
int icon = 0;
|
||||
Uri dataUri;
|
||||
int count = 0;
|
||||
while (namesIt.hasNext()) {
|
||||
item = namesIt.next();
|
||||
dataUri = null;
|
||||
|
|
Loading…
Reference in a new issue