Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Nullability Annotations to Java Classes] Replace org.jetbrains with androidx annotations #2804

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.wordpress.android.fluxc.network.rest;

import androidx.annotation.Nullable;

import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
Expand All @@ -10,7 +12,6 @@
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;

import org.jetbrains.annotations.Nullable;
import org.wordpress.android.fluxc.logging.FluxCCrashLogger;
import org.wordpress.android.fluxc.logging.FluxCCrashLoggerProvider;
import org.wordpress.android.fluxc.network.BaseRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.volley.Request;
import com.android.volley.RequestQueue;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.wordpress.android.fluxc.Dispatcher;
import org.wordpress.android.fluxc.generated.AuthenticationActionBuilder;
import org.wordpress.android.fluxc.network.AcceptHeaderStrategy;
Expand Down Expand Up @@ -150,11 +151,11 @@ private void addAcceptHeaderIfNeeded(BaseRequest request) {
}


private @NotNull String getLocaleParamName(@NotNull String url) {
private @NonNull String getLocaleParamName(@NonNull String url) {
return url.contains(WPCOM_V2_PREFIX) ? LOCALE_PARAM_NAME_FOR_V2 : LOCALE_PARAM_NAME_FOR_V1;
}

protected @Nullable HttpUrl getHttpUrlWithLocale(@NotNull String url) {
protected @Nullable HttpUrl getHttpUrlWithLocale(@NonNull String url) {
HttpUrl httpUrl = HttpUrl.parse(url);

if (null != httpUrl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.android.volley.RequestQueue;
import com.android.volley.Response.Listener;

import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -320,7 +319,7 @@ public void onErrorResponse(@NonNull BaseNetworkError error) {
add(request);
}

private @NotNull List<PostListItem> postListItemsFromPostsResponse(@Nullable Object[] response) {
private @NonNull List<PostListItem> postListItemsFromPostsResponse(@Nullable Object[] response) {
if (response == null) {
return Collections.emptyList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import org.wordpress.android.fluxc.BuildConfig;
import org.wordpress.android.fluxc.Dispatcher;
import org.wordpress.android.fluxc.Payload;
Expand Down Expand Up @@ -104,8 +103,8 @@ public PostListItem(Long remotePostId, String lastModified, String status, Strin

@SuppressWarnings("WeakerAccess")
public static class FetchPostListResponsePayload extends Payload<PostError> {
@NotNull public PostListDescriptor listDescriptor;
@NotNull public List<PostListItem> postListItems;
@NonNull public PostListDescriptor listDescriptor;
@NonNull public List<PostListItem> postListItems;
public boolean loadedMore;
public boolean canLoadMore;

Expand Down