Use Objects.requireNonNull().
This commit is contained in:
parent
0cdd866393
commit
14a2171035
6 changed files with 16 additions and 25 deletions
|
|
@ -19,6 +19,7 @@ import org.schabi.newpipe.util.ShareUtils;
|
|||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Objects;
|
||||
|
||||
import io.reactivex.rxjava3.disposables.CompositeDisposable;
|
||||
|
||||
|
|
@ -35,12 +36,9 @@ public class LicenseFragment extends Fragment {
|
|||
private final CompositeDisposable compositeDisposable = new CompositeDisposable();
|
||||
|
||||
public static LicenseFragment newInstance(final SoftwareComponent[] softwareComponents) {
|
||||
if (softwareComponents == null) {
|
||||
throw new NullPointerException("softwareComponents is null");
|
||||
}
|
||||
final LicenseFragment fragment = new LicenseFragment();
|
||||
final Bundle bundle = new Bundle();
|
||||
bundle.putParcelableArray(ARG_COMPONENTS, softwareComponents);
|
||||
bundle.putParcelableArray(ARG_COMPONENTS, Objects.requireNonNull(softwareComponents));
|
||||
final LicenseFragment fragment = new LicenseFragment();
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,10 +246,7 @@ public class DownloadSettingsFragment extends BasePreferenceFragment {
|
|||
|
||||
|
||||
// revoke permissions on the old save path (required for SAF only)
|
||||
final Context context = getContext();
|
||||
if (context == null) {
|
||||
throw new NullPointerException("getContext()");
|
||||
}
|
||||
final Context context = requireContext();
|
||||
|
||||
forgetSAFTree(context, defaultPreferences.getString(key, ""));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue