Remove useless initialization and null check
@@ -345,7 +345,7 @@ public class StarredFragment extends Fragment implements
public void importFromStorage() {
//Use SAF
- Intent intent = null;
+ Intent intent;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
@@ -396,7 +396,6 @@ public class StarredFragment extends Fragment implements
builder.append(line);
}
String list = builder.toString();
- if (list != null) {
JSONObject savedList = new JSONObject(list);
String bib = savedList.getString(JSON_LIBRARY_NAME);
//disallow import if from different library than current library
@@ -423,9 +422,6 @@ public class StarredFragment extends Fragment implements
} else {
showImportError();
}
- } else {
- showImportError();
- }
} catch (FileNotFoundException | JSONException | UnsupportedEncodingException e) {
showImportError();
} catch (IOException e) {
