From a604fe1181bda241d8f0a5e07c96d7c432b44dfb Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Fri, 16 Nov 2018 16:11:47 -0500 Subject: [PATCH] Add some missing Nullable annotations --- .../main/java/retrofit2/RequestFactory.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/retrofit/src/main/java/retrofit2/RequestFactory.java b/retrofit/src/main/java/retrofit2/RequestFactory.java index ee1ab0265d..aaa00d4624 100644 --- a/retrofit/src/main/java/retrofit2/RequestFactory.java +++ b/retrofit/src/main/java/retrofit2/RequestFactory.java @@ -68,9 +68,9 @@ static RequestFactory parseAnnotations(Retrofit retrofit, Method method) { private final Method method; private final HttpUrl baseUrl; final String httpMethod; - private final String relativeUrl; - private final Headers headers; - private final MediaType contentType; + private final @Nullable String relativeUrl; + private final @Nullable Headers headers; + private final @Nullable MediaType contentType; private final boolean hasBody; private final boolean isFormEncoded; private final boolean isMultipart; @@ -138,15 +138,15 @@ static final class Builder { boolean gotQueryName; boolean gotQueryMap; boolean gotUrl; - String httpMethod; + @Nullable String httpMethod; boolean hasBody; boolean isFormEncoded; boolean isMultipart; - String relativeUrl; - Headers headers; - MediaType contentType; - Set relativeUrlParamNames; - ParameterHandler[] parameterHandlers; + @Nullable String relativeUrl; + @Nullable Headers headers; + @Nullable MediaType contentType; + @Nullable Set relativeUrlParamNames; + @Nullable ParameterHandler[] parameterHandlers; Builder(Retrofit retrofit, Method method) { this.retrofit = retrofit; @@ -314,6 +314,7 @@ private ParameterHandler parseParameter( return result; } + @Nullable private ParameterHandler parseParameterAnnotation( int p, Type type, Annotation[] annotations, Annotation annotation) { if (annotation instanceof Url) {