From 7bb34d82d675a15647371ee7e02bae4f46143302 Mon Sep 17 00:00:00 2001
From: Josh Feinberg <15068619+joshafeinberg@users.noreply.github.com>
Date: Tue, 5 May 2026 14:10:20 -0500
Subject: [PATCH 1/6] Replace legacy nullability comments with Checker
annotations
Convert handwritten Java sources from Checker Framework comment-style
nullability markers to real Checker Framework type-use annotations. Add
checker-qual as an API dependency and update dependency guard snapshots
for downstream modules.
---
.../dependencies/releaseRuntimeClasspath.txt | 1 +
core/build.gradle | 1 +
core/dependencies/runtimeClasspath.txt | 1 +
.../com/dropbox/core/DbxApiException.java | 2 +-
.../java/com/dropbox/core/DbxAppInfo.java | 8 +-
.../java/com/dropbox/core/DbxAuthFinish.java | 14 +-
.../main/java/com/dropbox/core/DbxHost.java | 6 +-
.../com/dropbox/core/DbxRequestConfig.java | 18 +-
.../java/com/dropbox/core/DbxRequestUtil.java | 58 +++---
.../com/dropbox/core/DbxSessionStore.java | 4 +-
.../dropbox/core/DbxStandardSessionStore.java | 4 +-
.../java/com/dropbox/core/DbxWebAuth.java | 6 +-
.../core/http/GoogleAppEngineRequestor.java | 1 -
.../dropbox/core/http/OkHttp3Requestor.java | 1 -
.../dropbox/core/http/OkHttpRequestor.java | 1 -
.../core/http/StandardHttpRequestor.java | 3 +-
.../dropbox/core/json/JsonReadException.java | 8 +-
.../com/dropbox/core/json/JsonReader.java | 8 +-
.../com/dropbox/core/oauth/DbxCredential.java | 9 +-
.../dropbox/core/oauth/DbxRefreshResult.java | 6 +-
.../java/com/dropbox/core/util/Collector.java | 10 +-
.../com/dropbox/core/util/DumpWriter.java | 20 +-
.../java/com/dropbox/core/util/Dumpable.java | 4 +-
.../java/com/dropbox/core/util/LangUtil.java | 13 +-
.../java/com/dropbox/core/v1/DbxClientV1.java | 182 +++++++++---------
.../java/com/dropbox/core/v1/DbxDelta.java | 8 +-
.../java/com/dropbox/core/v1/DbxDeltaC.java | 8 +-
.../java/com/dropbox/core/v1/DbxEntry.java | 78 ++++----
.../java/com/dropbox/core/v1/DbxPathV1.java | 6 +-
.../java/com/dropbox/core/v2/DbxPathV2.java | 6 +-
.../com/dropbox/core/v2/DbxRawClientV2.java | 4 -
.../dependencies/releaseRuntimeClasspath.txt | 1 +
.../java/dependencies/compileClasspath.txt | 1 +
.../java/dependencies/runtimeClasspath.txt | 1 +
gradle/dropboxJavaSdkLibs.versions.toml | 3 +-
35 files changed, 251 insertions(+), 254 deletions(-)
diff --git a/android/dependencies/releaseRuntimeClasspath.txt b/android/dependencies/releaseRuntimeClasspath.txt
index a2cb92815..6cb429ef8 100644
--- a/android/dependencies/releaseRuntimeClasspath.txt
+++ b/android/dependencies/releaseRuntimeClasspath.txt
@@ -2,6 +2,7 @@ ch.randelshofer:fastdoubleparser:0.8.0
com.fasterxml.jackson.core:jackson-core:2.15.0
com.fasterxml.jackson:jackson-bom:2.15.0
com.google.code.findbugs:jsr305:3.0.2
+org.checkerframework:checker-qual:4.1.0
org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21
diff --git a/core/build.gradle b/core/build.gradle
index 1fe17fe26..dbc4fd842 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -56,6 +56,7 @@ sourceSets.main.java.srcDir(versionWriterTask)
dependencies {
api(dropboxJavaSdkLibs.jackson.core)
+ api(dropboxJavaSdkLibs.checker.qual)
api(dropboxJavaSdkLibs.jsr305)
compileOnly dropboxJavaSdkLibs.appengine.api
diff --git a/core/dependencies/runtimeClasspath.txt b/core/dependencies/runtimeClasspath.txt
index cb8c1810a..7a6f11f84 100644
--- a/core/dependencies/runtimeClasspath.txt
+++ b/core/dependencies/runtimeClasspath.txt
@@ -2,3 +2,4 @@ ch.randelshofer:fastdoubleparser:0.8.0
com.fasterxml.jackson.core:jackson-core:2.15.0
com.fasterxml.jackson:jackson-bom:2.15.0
com.google.code.findbugs:jsr305:3.0.2
+org.checkerframework:checker-qual:4.1.0
diff --git a/core/src/main/java/com/dropbox/core/DbxApiException.java b/core/src/main/java/com/dropbox/core/DbxApiException.java
index 2b96328e2..410c81ccb 100644
--- a/core/src/main/java/com/dropbox/core/DbxApiException.java
+++ b/core/src/main/java/com/dropbox/core/DbxApiException.java
@@ -1,6 +1,6 @@
package com.dropbox.core;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.qual.Nullable;
/**
* Base class for API-specific exceptions raised by API v2 routes.
diff --git a/core/src/main/java/com/dropbox/core/DbxAppInfo.java b/core/src/main/java/com/dropbox/core/DbxAppInfo.java
index 4183e2e80..1a993110a 100644
--- a/core/src/main/java/com/dropbox/core/DbxAppInfo.java
+++ b/core/src/main/java/com/dropbox/core/DbxAppInfo.java
@@ -1,5 +1,6 @@
package com.dropbox.core;
+import org.checkerframework.checker.nullness.qual.Nullable;
import java.io.IOException;
import static com.dropbox.core.util.StringUtil.jq;
@@ -13,7 +14,6 @@
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* Identifying information about your application.
@@ -125,7 +125,7 @@ protected void dumpFields(DumpWriter out) {
* that what you passed in is an actual valid Dropbox API app key.
*
*/
- public static /*@Nullable*/String getKeyFormatError(String key) {
+ public static @Nullable String getKeyFormatError(String key) {
return getTokenPartError(key);
}
@@ -139,7 +139,7 @@ protected void dumpFields(DumpWriter out) {
* you passed in is an actual valid Dropbox API app key.
*
*/
- public static /*@Nullable*/String getSecretFormatError(String key) {
+ public static @Nullable String getSecretFormatError(String key) {
return getTokenPartError(key);
}
@@ -232,7 +232,7 @@ public String read(JsonParser parser) throws IOException, JsonReadException
};
- public static /*@Nullable*/String getTokenPartError(String s)
+ public static @Nullable String getTokenPartError(String s)
{
if (s == null) return null;
if (s.length() == 0) return "can't be empty";
diff --git a/core/src/main/java/com/dropbox/core/DbxAuthFinish.java b/core/src/main/java/com/dropbox/core/DbxAuthFinish.java
index 6a661e0b7..ae622b5f3 100644
--- a/core/src/main/java/com/dropbox/core/DbxAuthFinish.java
+++ b/core/src/main/java/com/dropbox/core/DbxAuthFinish.java
@@ -1,5 +1,6 @@
package com.dropbox.core;
+import org.checkerframework.checker.nullness.qual.Nullable;
import com.dropbox.core.json.JsonReadException;
import com.dropbox.core.json.JsonReader;
import com.fasterxml.jackson.core.JsonLocation;
@@ -11,7 +12,6 @@
import static com.dropbox.core.util.StringUtil.jq;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* When you successfully complete the authorization process, the Dropbox server returns
@@ -24,7 +24,7 @@ public final class DbxAuthFinish {
private final String userId;
private final String accountId;
private final String teamId;
- private final /*@Nullable*/String urlState;
+ private final @Nullable String urlState;
private long issueTime;
private final String scope;
@@ -35,7 +35,7 @@ public final class DbxAuthFinish {
* was passed
*/
@Deprecated
- public DbxAuthFinish(String accessToken, String userId, String accountId, String teamId, /*@Nullable*/String urlState) {
+ public DbxAuthFinish(String accessToken, String userId, String accountId, String teamId, @Nullable String urlState) {
this(accessToken, null, null, userId, teamId, accountId, urlState);
}
@@ -53,7 +53,7 @@ public DbxAuthFinish(String accessToken, String userId, String accountId, String
* was passed
*/
public DbxAuthFinish(String accessToken, Long expiresIn, String refreshToken, String userId,
- String teamId, String accountId, /*@Nullable*/String urlState) {
+ String teamId, String accountId, @Nullable String urlState) {
this(accessToken, expiresIn, refreshToken, userId, teamId, accountId, urlState, null);
}
@@ -74,7 +74,7 @@ public DbxAuthFinish(String accessToken, Long expiresIn, String refreshToken, St
* will get HTTP 401.
*/
public DbxAuthFinish(String accessToken, Long expiresIn, String refreshToken, String userId,
- String teamId, String accountId, /*@Nullable*/String urlState, String
+ String teamId, String accountId, @Nullable String urlState, String
scope) {
this.accessToken = accessToken;
this.expiresIn = expiresIn;
@@ -175,7 +175,7 @@ public String getScope() {
* @return state data passed into {@link DbxWebAuth#start}, or {@code null} if no state was
* passed
*/
- public /*@Nullable*/ String getUrlState() {
+ public @Nullable String getUrlState() {
return urlState;
}
@@ -192,7 +192,7 @@ void setIssueTime(long issueTime) {
*
* @param urlState Custom state passed into /oauth2/authorize
*/
- DbxAuthFinish withUrlState(/*@Nullable*/ String urlState) {
+ DbxAuthFinish withUrlState(@Nullable String urlState) {
if (this.urlState != null) {
throw new IllegalStateException("Already have URL state.");
}
diff --git a/core/src/main/java/com/dropbox/core/DbxHost.java b/core/src/main/java/com/dropbox/core/DbxHost.java
index 684d88233..e3fd15e20 100644
--- a/core/src/main/java/com/dropbox/core/DbxHost.java
+++ b/core/src/main/java/com/dropbox/core/DbxHost.java
@@ -1,5 +1,6 @@
package com.dropbox.core;
+import org.checkerframework.checker.nullness.qual.Nullable;
import com.dropbox.core.json.JsonReadException;
import com.dropbox.core.json.JsonReader;
import com.dropbox.core.json.JsonWriter;
@@ -11,7 +12,6 @@
import java.io.IOException;
import java.util.Arrays;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* This is for mocking things out during testing. Most of the time you won't have to deal with
@@ -93,7 +93,7 @@ public int hashCode() {
}
@Override
- public boolean equals(/*@Nullable*/Object obj) {
+ public boolean equals(@Nullable Object obj) {
if (obj == this) {
return true;
} else if(obj instanceof DbxHost) {
@@ -168,7 +168,7 @@ else if (fieldName.equals("notify")) {
}
};
- private /*@Nullable*/String inferBaseHost() {
+ private @Nullable String inferBaseHost() {
if (web.startsWith("meta-") && api.startsWith("api-") && content.startsWith("api-content-") && notify.startsWith("api-notify-")) {
String webBase = web.substring("meta-".length());
String apiBase = api.substring("api-".length());
diff --git a/core/src/main/java/com/dropbox/core/DbxRequestConfig.java b/core/src/main/java/com/dropbox/core/DbxRequestConfig.java
index 54eec5c3e..78b75b725 100644
--- a/core/src/main/java/com/dropbox/core/DbxRequestConfig.java
+++ b/core/src/main/java/com/dropbox/core/DbxRequestConfig.java
@@ -1,11 +1,11 @@
package com.dropbox.core;
+import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Locale;
import com.dropbox.core.http.HttpRequestor;
import com.dropbox.core.http.StandardHttpRequestor;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* A grouping of a few configuration parameters for how we should make requests to the
@@ -13,11 +13,11 @@
*/
public class DbxRequestConfig {
private final String clientIdentifier;
- private final /*@Nullable*/String userLocale;
+ private final @Nullable String userLocale;
private final HttpRequestor httpRequestor;
private final int maxRetries;
- private DbxRequestConfig(String clientIdentifier, /*@Nullable*/ String userLocale, HttpRequestor httpRequestor, int maxRetries) {
+ private DbxRequestConfig(String clientIdentifier, @Nullable String userLocale, HttpRequestor httpRequestor, int maxRetries) {
if (clientIdentifier == null) throw new NullPointerException("clientIdentifier");
if (httpRequestor == null) throw new NullPointerException("httpRequestor");
if (maxRetries < 0) throw new IllegalArgumentException("maxRetries");
@@ -46,7 +46,7 @@ public DbxRequestConfig(String clientIdentifier) {
* @deprecated Use {@link #newBuilder} to customize configuration
*/
@Deprecated
- public DbxRequestConfig(String clientIdentifier, /*@Nullable*/ String userLocale) {
+ public DbxRequestConfig(String clientIdentifier, @Nullable String userLocale) {
this(clientIdentifier, userLocale, StandardHttpRequestor.INSTANCE);
}
@@ -60,7 +60,7 @@ public DbxRequestConfig(String clientIdentifier, /*@Nullable*/ String userLocale
* @deprecated Use {@link #newBuilder} to customize configuration
*/
@Deprecated
- public DbxRequestConfig(String clientIdentifier, /*@Nullable*/ String userLocale, HttpRequestor httpRequestor) {
+ public DbxRequestConfig(String clientIdentifier, @Nullable String userLocale, HttpRequestor httpRequestor) {
this(clientIdentifier, userLocale, httpRequestor, 0);
}
@@ -228,12 +228,12 @@ private static String toLanguageTag(String locale) {
public static final class Builder {
private final String clientIdentifier;
- private /*@Nullable*/ String userLocale;
+ private @Nullable String userLocale;
private HttpRequestor httpRequestor;
private int maxRetries;
private Builder(String clientIdentifier,
- /*@Nullable*/ String userLocale,
+ @Nullable String userLocale,
HttpRequestor httpRequestor,
int maxRetries) {
this.clientIdentifier = clientIdentifier;
@@ -262,7 +262,7 @@ private Builder(String clientIdentifier) {
*
* @return this builder
*/
- public Builder withUserLocale(/*@Nullable*/ String userLocale) {
+ public Builder withUserLocale(@Nullable String userLocale) {
this.userLocale = userLocale;
return this;
}
@@ -292,7 +292,7 @@ public Builder withUserLocaleFromPreferences() {
*
* @return this builder
*/
- public Builder withUserLocaleFrom(/*@Nullable*/ Locale userLocale) { // not named withUserLocale because of ambiguous calls when passing 'null'
+ public Builder withUserLocaleFrom(@Nullable Locale userLocale) { // not named withUserLocale because of ambiguous calls when passing 'null'
this.userLocale = toLanguageTag(userLocale);
return this;
}
diff --git a/core/src/main/java/com/dropbox/core/DbxRequestUtil.java b/core/src/main/java/com/dropbox/core/DbxRequestUtil.java
index 3f3df6d81..c050ca45b 100644
--- a/core/src/main/java/com/dropbox/core/DbxRequestUtil.java
+++ b/core/src/main/java/com/dropbox/core/DbxRequestUtil.java
@@ -1,5 +1,6 @@
package com.dropbox.core;
+import org.checkerframework.checker.nullness.qual.Nullable;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
@@ -32,7 +33,6 @@
import static com.dropbox.core.util.StringUtil.jq;
import static com.dropbox.core.util.LangUtil.mkAssert;
-/*>>> import checkers.nullness.quals.Nullable; */
public final class DbxRequestUtil {
private static final Random RAND = new Random();
@@ -47,10 +47,10 @@ public static String encodeUrlParam(String s) {
}
}
- public static String buildUrlWithParams(/*@Nullable*/String userLocale,
+ public static String buildUrlWithParams(@Nullable String userLocale,
String host,
String path,
- /*@Nullable*/String/*@Nullable*/[] params) {
+ @Nullable String @Nullable [] params) {
return buildUri(host, path) + "?" + encodeUrlParams(userLocale, params);
}
@@ -74,8 +74,8 @@ public static String buildUri(String host, String path) {
}
}
- private static String encodeUrlParams(/*@Nullable*/String userLocale,
- /*@Nullable*/String/*@Nullable*/[] params) {
+ private static String encodeUrlParams(@Nullable String userLocale,
+ @Nullable String @Nullable [] params) {
StringBuilder buf = new StringBuilder();
String sep = "";
if (userLocale != null) {
@@ -104,7 +104,7 @@ private static String encodeUrlParams(/*@Nullable*/String userLocale,
return buf.toString();
}
- public static List addAuthHeader(/*@Nullable*/List headers, String accessToken) {
+ public static List addAuthHeader(@Nullable List headers, String accessToken) {
if (accessToken == null) throw new NullPointerException("accessToken");
if (headers == null) headers = new ArrayList();
@@ -112,7 +112,7 @@ public static List addAuthHeader(/*@Nullable*/List addSelectUserHeader(/*@Nullable*/List headers, String memberId) {
+ public static List addSelectUserHeader(@Nullable List headers, String memberId) {
if (memberId == null) throw new NullPointerException("memberId");
if (headers == null) headers = new ArrayList();
@@ -120,7 +120,7 @@ public static List addSelectUserHeader(/*@Nullable*/List addSelectAdminHeader(/*@Nullable*/List headers, String adminId) {
+ public static List addSelectAdminHeader(@Nullable List headers, String adminId) {
if (adminId == null) throw new NullPointerException("adminId");
if (headers == null) headers = new ArrayList();
@@ -128,7 +128,7 @@ public static List addSelectAdminHeader(/*@Nullable*/List<
return headers;
}
- public static List addBasicAuthHeader(/*@Nullable*/List headers, String username, String password) {
+ public static List addBasicAuthHeader(@Nullable List headers, String username, String password) {
if (username == null) throw new NullPointerException("username");
if (password == null) throw new NullPointerException("password");
if (headers == null) headers = new ArrayList();
@@ -140,7 +140,7 @@ public static List addBasicAuthHeader(/*@Nullable*/List addUserAgentHeader(
- /*@Nullable*/List headers,
+ @Nullable List headers,
DbxRequestConfig requestConfig,
String sdkUserAgentIdentifier
) {
@@ -149,7 +149,7 @@ public static List addUserAgentHeader(
return headers;
}
- public static List addUserLocaleHeader(/*@Nullable*/List headers, DbxRequestConfig requestConfig) {
+ public static List addUserLocaleHeader(@Nullable List headers, DbxRequestConfig requestConfig) {
if (requestConfig.getUserLocale() == null) {
return headers;
}
@@ -163,7 +163,7 @@ public static HttpRequestor.Header buildUserAgentHeader(DbxRequestConfig request
return new HttpRequestor.Header("User-Agent", requestConfig.getClientIdentifier() + " " + sdkUserAgentIdentifier + "/" + DbxSdkVersion.Version);
}
- public static List addPathRootHeader(/*@Nullable*/List headers, PathRoot pathRoot) {
+ public static List addPathRootHeader(@Nullable List headers, PathRoot pathRoot) {
if (pathRoot == null) {
return headers;
}
@@ -173,7 +173,7 @@ public static List addPathRootHeader(/*@Nullable*/List removeAuthHeader(/*@Nullable*/List headers) {
+ public static List removeAuthHeader(@Nullable List headers) {
if (headers == null) {
return new ArrayList();
}
@@ -198,8 +198,8 @@ public static HttpRequestor.Response startGet(DbxRequestConfig requestConfig,
String sdkUserAgentIdentifier,
String host,
String path,
- /*@Nullable*/String/*@Nullable*/[] params,
- /*@Nullable*/List headers)
+ @Nullable String @Nullable [] params,
+ @Nullable List headers)
throws NetworkIOException {
headers = copyHeaders(headers);
headers = addUserAgentHeader(headers, requestConfig, sdkUserAgentIdentifier);
@@ -221,8 +221,8 @@ public static HttpRequestor.Uploader startPut(DbxRequestConfig requestConfig,
String accessToken,
String sdkUserAgentIdentifier,
String host, String path,
- /*@Nullable*/String/*@Nullable*/[] params,
- /*@Nullable*/List headers)
+ @Nullable String @Nullable [] params,
+ @Nullable List headers)
throws NetworkIOException {
headers = copyHeaders(headers);
headers = addUserAgentHeader(headers, requestConfig, sdkUserAgentIdentifier);
@@ -244,8 +244,8 @@ public static HttpRequestor.Response startPostNoAuth(DbxRequestConfig requestCon
String sdkUserAgentIdentifier,
String host,
String path,
- /*@Nullable*/String/*@Nullable*/[] params,
- /*@Nullable*/List headers)
+ @Nullable String @Nullable [] params,
+ @Nullable List headers)
throws NetworkIOException {
byte[] encodedParams = StringUtil.stringToUtf8(encodeUrlParams(requestConfig.getUserLocale(), params));
@@ -264,7 +264,7 @@ public static HttpRequestor.Response startPostRaw(DbxRequestConfig requestConfig
String host,
String path,
byte[] body,
- /*@Nullable*/List headers)
+ @Nullable List headers)
throws NetworkIOException {
String uri = buildUri(host, path);
@@ -459,8 +459,8 @@ public static T doGet(final DbxRequestConfig requestConfig,
final String sdkUserAgentIdentifier,
final String host,
final String path,
- final /*@Nullable*/String/*@Nullable*/[] params,
- final /*@Nullable*/List headers,
+ final @Nullable String @Nullable [] params,
+ final @Nullable List headers,
final ResponseHandler handler)
throws DbxException {
return runAndRetry(requestConfig.getMaxRetries(), new RequestMaker() {
@@ -486,8 +486,8 @@ public static T doPost(DbxRequestConfig requestConfig,
String sdkUserAgentIdentifier,
String host,
String path,
- /*@Nullable*/String/*@Nullable*/[] params,
- /*@Nullable*/List headers,
+ @Nullable String @Nullable [] params,
+ @Nullable List headers,
ResponseHandler handler)
throws DbxException {
headers = copyHeaders(headers);
@@ -499,8 +499,8 @@ public static T doPostNoAuth(final DbxRequestConfig requestConfig,
final String sdkUserAgentIdentifier,
final String host,
final String path,
- final /*@Nullable*/String/*@Nullable*/[] params,
- final /*@Nullable*/List headers,
+ final @Nullable String @Nullable [] params,
+ final @Nullable List headers,
final ResponseHandler handler)
throws DbxException {
return runAndRetry(requestConfig.getMaxRetries(), new RequestMaker() {
@@ -530,7 +530,7 @@ public static String getFirstHeader(HttpRequestor.Response response, String name
return values.get(0);
}
- public static /*@Nullable*/String getFirstHeaderMaybe(HttpRequestor.Response response, String name) {
+ public static @Nullable String getFirstHeaderMaybe(HttpRequestor.Response response, String name) {
List values = response.getHeaders().get(name);
if (values == null || values.isEmpty()) {
return null;
@@ -538,11 +538,11 @@ public static String getFirstHeader(HttpRequestor.Response response, String name
return values.get(0);
}
- public static /*@Nullable*/ String getRequestId(HttpRequestor.Response response) {
+ public static @Nullable String getRequestId(HttpRequestor.Response response) {
return DbxRequestUtil.getFirstHeaderMaybe(response, "X-Dropbox-Request-Id");
}
- public static /*@Nullable*/ String getContentType(HttpRequestor.Response response) {
+ public static @Nullable String getContentType(HttpRequestor.Response response) {
return DbxRequestUtil.getFirstHeaderMaybe(response, "Content-Type");
}
diff --git a/core/src/main/java/com/dropbox/core/DbxSessionStore.java b/core/src/main/java/com/dropbox/core/DbxSessionStore.java
index ad2e887ad..8721c3d9b 100644
--- a/core/src/main/java/com/dropbox/core/DbxSessionStore.java
+++ b/core/src/main/java/com/dropbox/core/DbxSessionStore.java
@@ -1,6 +1,6 @@
package com.dropbox.core;
-/*>>> import checkers.nullness.quals.Nullable; */
+import org.checkerframework.checker.nullness.qual.Nullable;
/**
* An interface that lets you save, retrieve, and clear a single value in the user's web
@@ -12,7 +12,7 @@
*
*/
public interface DbxSessionStore {
- public /*@Nullable*/String get();
+ public @Nullable String get();
public void set(String value);
public void clear();
}
diff --git a/core/src/main/java/com/dropbox/core/DbxStandardSessionStore.java b/core/src/main/java/com/dropbox/core/DbxStandardSessionStore.java
index 8525e95c3..cedad0956 100644
--- a/core/src/main/java/com/dropbox/core/DbxStandardSessionStore.java
+++ b/core/src/main/java/com/dropbox/core/DbxStandardSessionStore.java
@@ -1,8 +1,8 @@
package com.dropbox.core;
+import org.checkerframework.checker.nullness.qual.Nullable;
import jakarta.servlet.http.HttpSession;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* A {@link DbxSessionStore} implementation that stores the value using the standard
@@ -37,7 +37,7 @@ public String getKey() {
}
@Override
- public /*@Nullable*/String get() {
+ public @Nullable String get() {
Object v = session.getAttribute(key);
if (v instanceof String) return (String) v;
return null;
diff --git a/core/src/main/java/com/dropbox/core/DbxWebAuth.java b/core/src/main/java/com/dropbox/core/DbxWebAuth.java
index 4baef1f07..74f3f49ce 100644
--- a/core/src/main/java/com/dropbox/core/DbxWebAuth.java
+++ b/core/src/main/java/com/dropbox/core/DbxWebAuth.java
@@ -1,5 +1,6 @@
package com.dropbox.core;
+import org.checkerframework.checker.nullness.qual.Nullable;
import static com.dropbox.core.util.StringUtil.jq;
import java.nio.charset.Charset;
@@ -14,7 +15,6 @@
import com.dropbox.core.util.StringUtil;
import com.dropbox.core.v2.DbxRawClientV2;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* Does the OAuth 2 "authorization code" flow. (This SDK does not support the "token" flow.)
@@ -214,7 +214,7 @@ public DbxWebAuth(DbxRequestConfig requestConfig, DbxAppInfo appInfo) {
* instead.
*/
@Deprecated
- public String start(/*@Nullable*/String urlState) {
+ public String start(@Nullable String urlState) {
if (deprecatedRequest == null) {
throw new IllegalStateException("Must use DbxWebAuth.authorize instead.");
}
@@ -544,7 +544,7 @@ private static String verifyAndStripCsrfToken(String state, DbxSessionStore sess
return stripped.isEmpty() ? null : stripped;
}
- static /*@Nullable*/String getParam(Map params, String name) throws BadRequestException {
+ static @Nullable String getParam(Map params, String name) throws BadRequestException {
String[] v = params.get(name);
if (v == null) {
diff --git a/core/src/main/java/com/dropbox/core/http/GoogleAppEngineRequestor.java b/core/src/main/java/com/dropbox/core/http/GoogleAppEngineRequestor.java
index 5a513f7a9..41d50b35c 100644
--- a/core/src/main/java/com/dropbox/core/http/GoogleAppEngineRequestor.java
+++ b/core/src/main/java/com/dropbox/core/http/GoogleAppEngineRequestor.java
@@ -19,7 +19,6 @@
import com.google.appengine.api.urlfetch.URLFetchService;
import com.google.appengine.api.urlfetch.URLFetchServiceFactory;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* {@link HttpRequestor} implementation that uses Google App Engine URL fetch service.
diff --git a/core/src/main/java/com/dropbox/core/http/OkHttp3Requestor.java b/core/src/main/java/com/dropbox/core/http/OkHttp3Requestor.java
index 8978c45ba..21396fbde 100644
--- a/core/src/main/java/com/dropbox/core/http/OkHttp3Requestor.java
+++ b/core/src/main/java/com/dropbox/core/http/OkHttp3Requestor.java
@@ -21,7 +21,6 @@
import okio.*;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* {@link HttpRequestor} implementation that uses OkHttp
diff --git a/core/src/main/java/com/dropbox/core/http/OkHttpRequestor.java b/core/src/main/java/com/dropbox/core/http/OkHttpRequestor.java
index 9de7e5eee..130883b19 100644
--- a/core/src/main/java/com/dropbox/core/http/OkHttpRequestor.java
+++ b/core/src/main/java/com/dropbox/core/http/OkHttpRequestor.java
@@ -21,7 +21,6 @@
import okio.*;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* {@link HttpRequestor} implementation that uses OkHttp
diff --git a/core/src/main/java/com/dropbox/core/http/StandardHttpRequestor.java b/core/src/main/java/com/dropbox/core/http/StandardHttpRequestor.java
index 51d4878c7..d968b25e6 100644
--- a/core/src/main/java/com/dropbox/core/http/StandardHttpRequestor.java
+++ b/core/src/main/java/com/dropbox/core/http/StandardHttpRequestor.java
@@ -9,14 +9,13 @@
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
-import javax.annotation.Nullable;
+import org.checkerframework.checker.nullness.qual.Nullable;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory;
import com.dropbox.core.util.IOUtil;
import com.dropbox.core.util.ProgressOutputStream;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* {@link HttpRequestor} implementation that uses Java's standard library
diff --git a/core/src/main/java/com/dropbox/core/json/JsonReadException.java b/core/src/main/java/com/dropbox/core/json/JsonReadException.java
index 2bbc572ef..bb77a6146 100644
--- a/core/src/main/java/com/dropbox/core/json/JsonReadException.java
+++ b/core/src/main/java/com/dropbox/core/json/JsonReadException.java
@@ -1,11 +1,11 @@
package com.dropbox.core.json;
+import org.checkerframework.checker.nullness.qual.Nullable;
import com.fasterxml.jackson.core.JsonLocation;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.File;
-/*>>> import checkers.nullness.quals.Nullable; */
public final class JsonReadException extends java.lang.Exception
{
@@ -13,7 +13,7 @@ public final class JsonReadException extends java.lang.Exception
public final String error;
public final JsonLocation location;
- private /*@Nullable*/PathPart path;
+ private @Nullable PathPart path;
public JsonReadException(String error, JsonLocation location)
{
@@ -85,9 +85,9 @@ public static void toStringLocation(StringBuilder buf, JsonLocation location)
public static final class PathPart
{
public final String description;
- public final /*@Nullable*/PathPart next;
+ public final @Nullable PathPart next;
- public PathPart(String description, /*@Nullable*/PathPart next)
+ public PathPart(String description, @Nullable PathPart next)
{
this.description = description;
this.next = next;
diff --git a/core/src/main/java/com/dropbox/core/json/JsonReader.java b/core/src/main/java/com/dropbox/core/json/JsonReader.java
index ffb037335..71ce0c6ea 100644
--- a/core/src/main/java/com/dropbox/core/json/JsonReader.java
+++ b/core/src/main/java/com/dropbox/core/json/JsonReader.java
@@ -1,5 +1,6 @@
package com.dropbox.core.json;
+import org.checkerframework.checker.nullness.qual.Nullable;
import com.dropbox.core.util.IOUtil;
import static com.dropbox.core.util.LangUtil.mkAssert;
@@ -17,7 +18,6 @@
import java.util.HashMap;
-/*>>> import checkers.nullness.quals.Nullable; */
public abstract class JsonReader
{
@@ -41,14 +41,14 @@ public void validate(T value)
// Base implementation does nothing.
}
- public final T readField(JsonParser parser, String fieldName, /*@Nullable*/Object v)
+ public final T readField(JsonParser parser, String fieldName, @Nullable Object v)
throws IOException, JsonReadException
{
if (v != null) throw new JsonReadException("duplicate field \"" + fieldName + "\"", parser.getTokenLocation());
return read(parser);
}
- public final /*@Nullable*/T readOptional(JsonParser parser)
+ public final @Nullable T readOptional(JsonParser parser)
throws IOException, JsonReadException
{
if (parser.getCurrentToken() == JsonToken.VALUE_NULL) {
@@ -423,7 +423,7 @@ public int get(String fieldName)
public static final class Builder
{
- private /*@Nullable*/HashMap fields = new HashMap();
+ private @Nullable HashMap fields = new HashMap();
public void add(String fieldName, int expectedIndex)
{
diff --git a/core/src/main/java/com/dropbox/core/oauth/DbxCredential.java b/core/src/main/java/com/dropbox/core/oauth/DbxCredential.java
index 052a86172..eca78cdc9 100644
--- a/core/src/main/java/com/dropbox/core/oauth/DbxCredential.java
+++ b/core/src/main/java/com/dropbox/core/oauth/DbxCredential.java
@@ -1,5 +1,6 @@
package com.dropbox.core.oauth;
+import org.checkerframework.checker.nullness.qual.Nullable;
import com.dropbox.core.DbxException;
import com.dropbox.core.DbxHost;
import com.dropbox.core.DbxRequestConfig;
@@ -24,8 +25,6 @@
import static com.dropbox.core.oauth.DbxOAuthError.INVALID_REQUEST;
-/*>>> import checkers.nullness.quals.NonNull; */
-/*>>> import checkers.nullness.quals.Nullable; */
/**
*
@@ -45,7 +44,7 @@ public class DbxCredential {
public final static long EXPIRE_MARGIN = 5 * 60 * 1000; // 5 minutes
private String accessToken;
- private /*@Nullable*/Long expiresAt;
+ private @Nullable Long expiresAt;
private final String refreshToken;
private final String appKey;
private final String appSecret;
@@ -68,7 +67,7 @@ public DbxCredential(String accessToken) {
* @param refreshToken Refresh token from OAuth flow.
* @param appKey You app's client id.
*/
- public DbxCredential(String accessToken, /*Nullable*/Long expiresAt, String refreshToken, String
+ public DbxCredential(String accessToken, @Nullable Long expiresAt, String refreshToken, String
appKey) {
this(accessToken, expiresAt, refreshToken, appKey, null);
}
@@ -82,7 +81,7 @@ public DbxCredential(String accessToken, /*Nullable*/Long expiresAt, String refr
* @param appKey You app's client id.
* @param appSecret You app's client secret.
*/
- public DbxCredential(String accessToken, /*@Nullable*/Long expiresAt, String refreshToken, String appKey, String appSecret) {
+ public DbxCredential(String accessToken, @Nullable Long expiresAt, String refreshToken, String appKey, String appSecret) {
if (accessToken == null) {
throw new IllegalArgumentException("Missing access token.");
}
diff --git a/core/src/main/java/com/dropbox/core/oauth/DbxRefreshResult.java b/core/src/main/java/com/dropbox/core/oauth/DbxRefreshResult.java
index 0539fb0f3..cc4983d4b 100644
--- a/core/src/main/java/com/dropbox/core/oauth/DbxRefreshResult.java
+++ b/core/src/main/java/com/dropbox/core/oauth/DbxRefreshResult.java
@@ -1,5 +1,6 @@
package com.dropbox.core.oauth;
+import org.checkerframework.checker.nullness.qual.NonNull;
import com.dropbox.core.DbxAuthFinish;
import com.dropbox.core.DbxRequestConfig;
import com.dropbox.core.json.JsonReadException;
@@ -10,7 +11,6 @@
import java.io.IOException;
-/*>>> import checkers.nullness.quals.NonNull; */
/**
@@ -28,7 +28,7 @@ public class DbxRefreshResult {
* @param expiresIn Duration time of accessToken in second.
* was passed
*/
- public DbxRefreshResult(/*@NotNull*/String accessToken, long expiresIn) {
+ public DbxRefreshResult(@NonNull String accessToken, long expiresIn) {
this(accessToken, expiresIn, null);
}
@@ -37,7 +37,7 @@ public DbxRefreshResult(/*@NotNull*/String accessToken, long expiresIn) {
* @param expiresIn Duration time of accessToken in second.
* was passed
*/
- public DbxRefreshResult(/*@NotNull*/String accessToken, long expiresIn, String scope) {
+ public DbxRefreshResult(@NonNull String accessToken, long expiresIn, String scope) {
if (accessToken == null) {
throw new IllegalArgumentException("access token can't be null.");
}
diff --git a/core/src/main/java/com/dropbox/core/util/Collector.java b/core/src/main/java/com/dropbox/core/util/Collector.java
index a8d769fcf..c6cfe5e2d 100644
--- a/core/src/main/java/com/dropbox/core/util/Collector.java
+++ b/core/src/main/java/com/dropbox/core/util/Collector.java
@@ -1,8 +1,8 @@
package com.dropbox.core.util;
+import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList;
-/*>>> import checkers.nullness.quals.Nullable; */
public abstract class Collector
{
@@ -11,7 +11,7 @@ public abstract class Collector
public static final class ArrayListCollector extends Collector>
{
- private /*@Nullable*/ArrayList list = new ArrayList();
+ private @Nullable ArrayList list = new ArrayList();
public void add(E element)
{
@@ -28,7 +28,7 @@ public ArrayList finish()
}
}
- public static final class NullSkipper extends Collector*@Nullable*/E,L>
+ public static final class NullSkipper extends Collector<@Nullable E,L>
{
private final Collector underlying;
@@ -37,12 +37,12 @@ public NullSkipper(Collector underlying)
this.underlying = underlying;
}
- public static Collector*@Nullable*/E,L> mk(Collector underlying)
+ public static Collector<@Nullable E,L> mk(Collector underlying)
{
return new NullSkipper(underlying);
}
- public void add(/*@Nullable*/E element)
+ public void add(@Nullable E element)
{
if (element != null) {
underlying.add(element);
diff --git a/core/src/main/java/com/dropbox/core/util/DumpWriter.java b/core/src/main/java/com/dropbox/core/util/DumpWriter.java
index d500363b9..0c50fc24b 100644
--- a/core/src/main/java/com/dropbox/core/util/DumpWriter.java
+++ b/core/src/main/java/com/dropbox/core/util/DumpWriter.java
@@ -1,16 +1,16 @@
package com.dropbox.core.util;
+import org.checkerframework.checker.nullness.qual.Nullable;
import com.dropbox.core.json.JsonDateReader;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
-/*>>> import checkers.nullness.quals.Nullable; */
public abstract class DumpWriter
{
- public abstract DumpWriter recordStart(/*@Nullable*/String name);
+ public abstract DumpWriter recordStart(@Nullable String name);
public abstract DumpWriter recordEnd();
public abstract DumpWriter f(String name); // Write a field name. You should write a value after.
public abstract DumpWriter listStart();
@@ -63,7 +63,7 @@ private void indentLess()
}
@Override
- public DumpWriter recordStart(/*@Nullable*/String name)
+ public DumpWriter recordStart(@Nullable String name)
{
prefix();
if (name != null) {
@@ -149,7 +149,7 @@ private void sep()
}
@Override
- public DumpWriter recordStart(/*@Nullable*/String name)
+ public DumpWriter recordStart(@Nullable String name)
{
if (name != null) {
buf.append(name);
@@ -207,7 +207,7 @@ public DumpWriter fieldVerbatim(String name, String s)
return f(name).verbatim(s);
}
- public DumpWriter v(/*@Nullable*/Iterable extends Dumpable> list)
+ public DumpWriter v(@Nullable Iterable extends Dumpable> list)
{
if (list == null) {
verbatim("null");
@@ -221,7 +221,7 @@ public DumpWriter v(/*@Nullable*/Iterable extends Dumpable> list)
return this;
}
- public DumpWriter v(/*@Nullable*/String v)
+ public DumpWriter v(@Nullable String v)
{
if (v == null) {
verbatim("null");
@@ -236,10 +236,10 @@ public DumpWriter v(/*@Nullable*/String v)
public DumpWriter v(boolean v) { return verbatim(Boolean.toString(v)); }
public DumpWriter v(float v) { return verbatim(Float.toString(v)); }
public DumpWriter v(double v) { return verbatim(Double.toString(v)); }
- public DumpWriter v(/*@Nullable*/Date v) { return verbatim(toStringDate(v)); }
- public DumpWriter v(/*@Nullable*/Long v) { return verbatim(v == null ? "null" : Long.toString(v)); }
+ public DumpWriter v(@Nullable Date v) { return verbatim(toStringDate(v)); }
+ public DumpWriter v(@Nullable Long v) { return verbatim(v == null ? "null" : Long.toString(v)); }
- public DumpWriter v(/*@Nullable*/Dumpable v)
+ public DumpWriter v(@Nullable Dumpable v)
{
if (v == null) {
verbatim("null");
@@ -252,7 +252,7 @@ public DumpWriter v(/*@Nullable*/Dumpable v)
return this;
}
- public static String toStringDate(/*@Nullable*/Date date)
+ public static String toStringDate(@Nullable Date date)
{
if (date == null) {
return "null";
diff --git a/core/src/main/java/com/dropbox/core/util/Dumpable.java b/core/src/main/java/com/dropbox/core/util/Dumpable.java
index 0fc5c46e6..8362a7902 100644
--- a/core/src/main/java/com/dropbox/core/util/Dumpable.java
+++ b/core/src/main/java/com/dropbox/core/util/Dumpable.java
@@ -1,6 +1,6 @@
package com.dropbox.core.util;
-/*>>> import checkers.nullness.quals.Nullable; */
+import org.checkerframework.checker.nullness.qual.Nullable;
/**
* A common superclass for pure-data classes. Contains a function to dump
@@ -57,6 +57,6 @@ public final void toStringMultiline(StringBuilder buf, int currentIndent, boolea
new DumpWriter.Multiline(buf, 2, currentIndent, nl).v(this);
}
- protected /*@Nullable*/String getTypeName() { return null; }
+ protected @Nullable String getTypeName() { return null; }
protected abstract void dumpFields(DumpWriter out);
}
diff --git a/core/src/main/java/com/dropbox/core/util/LangUtil.java b/core/src/main/java/com/dropbox/core/util/LangUtil.java
index 9418f8567..5e0da27e6 100644
--- a/core/src/main/java/com/dropbox/core/util/LangUtil.java
+++ b/core/src/main/java/com/dropbox/core/util/LangUtil.java
@@ -1,12 +1,11 @@
package com.dropbox.core.util;
+import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
-/*>>> import checkers.nullness.quals.Nullable; */
-/*>>> import checkers.nullness.quals.NonNull; */
public class LangUtil
{
@@ -35,26 +34,26 @@ public static T[] arrayConcat(T[] a, T[] b)
{
if (a == null) throw new IllegalArgumentException("'a' can't be null");
if (b == null) throw new IllegalArgumentException("'b' can't be null");
- /*@Nullable*/T[] rn = Arrays.copyOf(a, a.length + b.length);
+ @Nullable T[] rn = Arrays.copyOf(a, a.length + b.length);
System.arraycopy(b, 0, rn, a.length, b.length);
@SuppressWarnings("nullness") T[] r = rn;
return r;
}
- public static boolean nullableEquals(/*@Nullable*/T a, /*@Nullable*/T b)
+ public static boolean nullableEquals(@Nullable T a, @Nullable T b)
{
if (a == null) return (b == null);
if (b == null) return false;
return a.equals(b);
}
- public static int nullableHashCode(/*@Nullable*/Object o)
+ public static int nullableHashCode(@Nullable Object o)
{
if (o == null) return 0;
return o.hashCode() + 1;
}
- public static Date truncateMillis(/*@Nullable*/Date date) {
+ public static Date truncateMillis(@Nullable Date date) {
if (date != null) {
long time = date.getTime();
return new Date(time - (time % 1000L));
@@ -63,7 +62,7 @@ public static Date truncateMillis(/*@Nullable*/Date date) {
}
}
- public static List truncateMillis(/*@Nullable*/List dates) {
+ public static List truncateMillis(@Nullable List dates) {
if (dates != null) {
List truncated = new ArrayList(dates.size());
for (Date date : dates) {
diff --git a/core/src/main/java/com/dropbox/core/v1/DbxClientV1.java b/core/src/main/java/com/dropbox/core/v1/DbxClientV1.java
index 3911291ef..a2bbeb128 100644
--- a/core/src/main/java/com/dropbox/core/v1/DbxClientV1.java
+++ b/core/src/main/java/com/dropbox/core/v1/DbxClientV1.java
@@ -1,5 +1,9 @@
package com.dropbox.core.v1;
+import org.checkerframework.checker.initialization.qual.Initialized;
+import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -20,10 +24,6 @@
import static com.dropbox.core.util.StringUtil.jq;
-/*>>> import checkers.nullness.quals.NonNull; */
-/*>>> import checkers.nullness.quals.Nullable; */
-/*>>> import checkers.nullness.quals.MonotonicNonNull; */
-/*>>> import checkers.initialization.quals.Initialized; */
/**
* Use this class to make remote calls to the Dropbox API. You'll need an access token first,
@@ -112,21 +112,21 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* metadata for that path. If there is no file or folder there,
* return {@code null}.
*/
- public /*@Nullable*/DbxEntry getMetadata(final String path, boolean includeMediaInfo)
+ public @Nullable DbxEntry getMetadata(final String path, boolean includeMediaInfo)
throws DbxException
{
DbxPathV1.checkArg("path", path);
String host = this.host.getApi();
String apiPath = "1/metadata/auto" + path;
- /*@Nullable*/String[] params = {
+ @Nullable String[] params = {
"list", "false",
"include_media_info", includeMediaInfo ? "true" : null,
};
- return doGet(host, apiPath, params, null, new DbxRequestUtil.ResponseHandler*@Nullable*/DbxEntry>() {
+ return doGet(host, apiPath, params, null, new DbxRequestUtil.ResponseHandler<@Nullable DbxEntry>() {
@Override
- public /*@Nullable*/DbxEntry handle(HttpRequestor.Response response) throws DbxException
+ public @Nullable DbxEntry handle(HttpRequestor.Response response) throws DbxException
{
if (response.getStatusCode() == 404) return null;
if (response.getStatusCode() != 200) throw DbxRequestUtil.unexpectedStatus(response);
@@ -140,7 +140,7 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* Same as {@link #getMetadata(String, boolean)} with {@code includeMediaInfo} set
* to {@code false}.
*/
- public /*@Nullable*/DbxEntry getMetadata(final String path)
+ public @Nullable DbxEntry getMetadata(final String path)
throws DbxException
{
return getMetadata(path, false);
@@ -171,7 +171,7 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* Otherwise, return the metadata for that path and the metadata for all its immediate
* children (if it's a folder).
*/
- public DbxEntry./*@Nullable*/WithChildren getMetadataWithChildren(String path, boolean includeMediaInfo)
+ public DbxEntry.@Nullable WithChildren getMetadataWithChildren(String path, boolean includeMediaInfo)
throws DbxException
{
return getMetadataWithChildrenBase(path, includeMediaInfo, DbxEntry.WithChildren.ReaderMaybeDeleted);
@@ -181,7 +181,7 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* Same as {@link #getMetadataWithChildren(String, boolean)} with {@code includeMediaInfo} set
* to {@code false}.
*/
- public DbxEntry./*@Nullable*/WithChildren getMetadataWithChildren(String path)
+ public DbxEntry.@Nullable WithChildren getMetadataWithChildren(String path)
throws DbxException
{
return getMetadataWithChildren(path, false);
@@ -201,7 +201,7 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* the entire call succeeds.
*
*/
- public DbxEntry./*@Nullable*/WithChildrenC getMetadataWithChildrenC(String path, boolean includeMediaInfo, final Collector collector)
+ public DbxEntry.@Nullable WithChildrenC getMetadataWithChildrenC(String path, boolean includeMediaInfo, final Collector collector)
throws DbxException
{
return getMetadataWithChildrenBase(path, includeMediaInfo, new DbxEntry.WithChildrenC.ReaderMaybeDeleted(collector));
@@ -211,13 +211,13 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* Same as {@link #getMetadataWithChildrenC(String, boolean, Collector)} with {@code includeMediaInfo} set
* to {@code false}.
*/
- public DbxEntry./*@Nullable*/WithChildrenC getMetadataWithChildrenC(String path, final Collector collector)
+ public DbxEntry.@Nullable WithChildrenC getMetadataWithChildrenC(String path, final Collector collector)
throws DbxException
{
return getMetadataWithChildrenC(path, false, collector);
}
- private /*@Nullable*/T getMetadataWithChildrenBase(String path, boolean includeMediaInfo, final JsonReader extends T> reader)
+ private @Nullable T getMetadataWithChildrenBase(String path, boolean includeMediaInfo, final JsonReader extends T> reader)
throws DbxException
{
DbxPathV1.checkArg("path", path);
@@ -225,15 +225,15 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
String host = this.host.getApi();
String apiPath = "1/metadata/auto" + path;
- /*@Nullable*/String[] params = {
+ @Nullable String[] params = {
"list", "true",
"file_limit", "25000",
"include_media_info", includeMediaInfo ? "true" : null,
};
- return doGet(host, apiPath, params, null, new DbxRequestUtil.ResponseHandler*@Nullable*/T>() {
+ return doGet(host, apiPath, params, null, new DbxRequestUtil.ResponseHandler<@Nullable T>() {
@Override
- public /*@Nullable*/T handle(HttpRequestor.Response response) throws DbxException
+ public @Nullable T handle(HttpRequestor.Response response) throws DbxException
{
if (response.getStatusCode() == 404) return null;
if (response.getStatusCode() != 200) throw DbxRequestUtil.unexpectedStatus(response);
@@ -261,7 +261,7 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* {@code Maybe.Just(null)} if there's nothing there or {@code Maybe.Just} with the
* metadata.
*/
- public Maybe getMetadataWithChildrenIfChanged(String path, boolean includeMediaInfo, /*@Nullable*/String previousFolderHash)
+ public Maybe getMetadataWithChildrenIfChanged(String path, boolean includeMediaInfo, @Nullable String previousFolderHash)
throws DbxException
{
return getMetadataWithChildrenIfChangedBase(path, includeMediaInfo, previousFolderHash, DbxEntry.WithChildren.ReaderMaybeDeleted);
@@ -271,7 +271,7 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* Same as {@link #getMetadataWithChildrenIfChanged(String, boolean, String)} with {@code includeMediaInfo} set
* to {@code false}.
*/
- public Maybe getMetadataWithChildrenIfChanged(String path, /*@Nullable*/String previousFolderHash)
+ public Maybe getMetadataWithChildrenIfChanged(String path, @Nullable String previousFolderHash)
throws DbxException
{
return getMetadataWithChildrenIfChanged(path, false, previousFolderHash);
@@ -291,8 +291,8 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* the entire call succeeds.
*
*/
- public Maybe> getMetadataWithChildrenIfChangedC(
- String path, boolean includeMediaInfo, /*@Nullable*/String previousFolderHash, Collector collector)
+ public Maybe> getMetadataWithChildrenIfChangedC(
+ String path, boolean includeMediaInfo, @Nullable String previousFolderHash, Collector collector)
throws DbxException
{
return getMetadataWithChildrenIfChangedBase(path, includeMediaInfo, previousFolderHash, new DbxEntry.WithChildrenC.ReaderMaybeDeleted(collector));
@@ -302,15 +302,15 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
* Same as {@link #getMetadataWithChildrenIfChangedC(String, boolean, String, Collector)} with
* {@code includeMediaInfo} set to {@code false}.
*/
- public Maybe> getMetadataWithChildrenIfChangedC(
- String path, /*@Nullable*/String previousFolderHash, Collector collector)
+ public Maybe> getMetadataWithChildrenIfChangedC(
+ String path, @Nullable String previousFolderHash, Collector collector)
throws DbxException
{
return getMetadataWithChildrenIfChangedC(path, false, previousFolderHash, collector);
}
- private Maybe*@Nullable*/T> getMetadataWithChildrenIfChangedBase(
- String path, boolean includeMediaInfo, /*@Nullable*/String previousFolderHash, final JsonReader reader)
+ private Maybe<@Nullable T> getMetadataWithChildrenIfChangedBase(
+ String path, boolean includeMediaInfo, @Nullable String previousFolderHash, final JsonReader reader)
throws DbxException
{
if (previousFolderHash == null) throw new IllegalArgumentException("'previousFolderHash' must not be null");
@@ -320,22 +320,22 @@ public DbxClientV1(DbxRequestConfig requestConfig, String accessToken, DbxHost h
String host = this.host.getApi();
String apiPath = "1/metadata/auto" + path;
- /*@Nullable*/String[] params = {
+ @Nullable String[] params = {
"list", "true",
"file_limit", "25000",
"hash", previousFolderHash,
"include_media_info", includeMediaInfo ? "true" : null,
};
- return doGet(host, apiPath, params, null, new DbxRequestUtil.ResponseHandler>() {
+ return doGet(host, apiPath, params, null, new DbxRequestUtil.ResponseHandler>() {
@Override
- public Maybe*@Nullable*/T> handle(HttpRequestor.Response response) throws DbxException
+ public Maybe<@Nullable T> handle(HttpRequestor.Response response) throws DbxException
{
- if (response.getStatusCode() == 404) return Maybe.*@Nullable*/T>Just(null);
- if (response.getStatusCode() == 304) return Maybe.*@Nullable*/T>Nothing();
+ if (response.getStatusCode() == 404) return Maybe.<@Nullable T>Just(null);
+ if (response.getStatusCode() == 304) return Maybe.<@Nullable T>Nothing();
if (response.getStatusCode() != 200) throw DbxRequestUtil.unexpectedStatus(response);
- return Maybe.*@Nullable*/T>Just(DbxRequestUtil.readJsonFromResponse(reader, response));
+ return Maybe.<@Nullable T>Just(DbxRequestUtil.readJsonFromResponse(reader, response));
}
});
}
@@ -377,9 +377,9 @@ public void disableAccessToken()
String host = this.host.getApi();
String apiPath = "1/disable_access_token";
- doPost(host, apiPath, null, null, new DbxRequestUtil.ResponseHandler*@Nullable*/Void>() {
+ doPost(host, apiPath, null, null, new DbxRequestUtil.ResponseHandler<@Nullable Void>() {
@Override
- public /*@Nullable*/Void handle(HttpRequestor.Response response) throws DbxException
+ public @Nullable Void handle(HttpRequestor.Response response) throws DbxException
{
if (response.getStatusCode() != 200) {
String requestId = DbxRequestUtil.getRequestId(response);
@@ -419,7 +419,7 @@ public void disableAccessToken()
* @throws IOException
* If there's an error writing to {@code target}.
*/
- public DbxEntry./*@Nullable*/File getFile(String path, /*@Nullable*/String rev, OutputStream target)
+ public DbxEntry.@Nullable File getFile(String path, @Nullable String rev, OutputStream target)
throws DbxException, IOException
{
Downloader downloader = startGetFile(path, rev);
@@ -454,12 +454,12 @@ public void disableAccessToken()
* An object that can be used to download the file contents, or
* {@code null} if there is no file at the requested path.
*/
- public /*@Nullable*/Downloader startGetFile(final String path, /*@Nullable*/String rev)
+ public @Nullable Downloader startGetFile(final String path, @Nullable String rev)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/files/auto" + path;
- /*@Nullable*/String[] params = {
+ @Nullable String[] params = {
"rev", rev
};
return startGetSomething(apiPath, params);
@@ -468,8 +468,8 @@ public void disableAccessToken()
/**
* Generic function that downloads either files or thumbnails.
*/
- private /*@Nullable*/Downloader startGetSomething(final String apiPath,
- final /*@Nullable*/String[] params)
+ private @Nullable Downloader startGetSomething(final String apiPath,
+ final @Nullable String[] params)
throws DbxException
{
final String host = this.host.getContent();
@@ -760,7 +760,7 @@ public DbxEntry.File uploadFileSingle(String targetPath, D
private static final class SingleUploader extends Uploader
{
- private HttpRequestor./*@Nullable*/Uploader httpUploader;
+ private HttpRequestor.@Nullable Uploader httpUploader;
private final long claimedBytes;
private final CountingOutputStream body;
@@ -843,7 +843,7 @@ public DbxEntry.File finish()
}
@SuppressWarnings("nullness") // Workaround for bug in Checker Framework: https://code.google.com/p/checker-framework/issues/detail?id=293
- final HttpRequestor./*@Initialized*//*@NonNull*/Response nonNullResponse = response;
+ final HttpRequestor.@Initialized @NonNull Response nonNullResponse = response;
return DbxRequestUtil.finishResponse(nonNullResponse, new DbxRequestUtil.ResponseHandler() {
@Override
@@ -967,7 +967,7 @@ private HttpRequestor.Response chunkedUploadCommon(String[
}
}
- private /*@Nullable*/ChunkedUploadState chunkedUploadCheckForOffsetCorrection(HttpRequestor.Response response)
+ private @Nullable ChunkedUploadState chunkedUploadCheckForOffsetCorrection(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() != 400) return null;
@@ -1333,7 +1333,7 @@ private final class ChunkedUploadOutputStream extends OutputStream
{
private final byte[] chunk;
private int chunkPos = 0;
- private /*@MonotonicNonNull*/String uploadId;
+ private @MonotonicNonNull String uploadId;
private long uploadOffset;
private ChunkedUploadOutputStream(int chunkSize)
@@ -1476,7 +1476,7 @@ public IODbxException(DbxException underlying)
* for the App Folder's contents.
*
*/
- public DbxDelta getDelta(/*@Nullable*/String cursor, boolean includeMediaInfo)
+ public DbxDelta getDelta(@Nullable String cursor, boolean includeMediaInfo)
throws DbxException
{
return _getDelta(cursor, null, includeMediaInfo);
@@ -1485,7 +1485,7 @@ public DbxDelta getDelta(/*@Nullable*/String cursor, boolean includeMe
/**
* Same as {@link #getDelta(String, boolean)} with {@code includeMediaInfo} set to {@code false}.
*/
- public DbxDelta getDelta(/*@Nullable*/String cursor)
+ public DbxDelta getDelta(@Nullable String cursor)
throws DbxException
{
return getDelta(cursor, false);
@@ -1495,7 +1495,7 @@ public DbxDelta getDelta(/*@Nullable*/String cursor)
* A more generic version of {@link #getDelta}. You provide a collector,
* which lets you process the delta entries as they arrive over the network.
*/
- public DbxDeltaC getDeltaC(Collector, C> collector, /*@Nullable*/String cursor,
+ public DbxDeltaC getDeltaC(Collector, C> collector, @Nullable String cursor,
boolean includeMediaInfo)
throws DbxException
{
@@ -1505,7 +1505,7 @@ public DbxDeltaC getDeltaC(Collector, C> collec
/**
* Same as {@link #getDeltaC(Collector, String, boolean)} with {@code includeMediaInfo} set to {@code false}.
*/
- public DbxDeltaC getDeltaC(Collector, C> collector, /*@Nullable*/String cursor)
+ public DbxDeltaC getDeltaC(Collector, C> collector, @Nullable String cursor)
throws DbxException
{
return getDeltaC(collector, cursor, false);
@@ -1524,7 +1524,7 @@ public DbxDeltaC getDeltaC(Collector, C> collec
* @param pathPrefix
* A path on Dropbox to limit results to.
*/
- public DbxDelta getDeltaWithPathPrefix(/*@Nullable*/String cursor, String pathPrefix,
+ public DbxDelta getDeltaWithPathPrefix(@Nullable String cursor, String pathPrefix,
boolean includeMediaInfo)
throws DbxException
{
@@ -1536,7 +1536,7 @@ public DbxDelta getDeltaWithPathPrefix(/*@Nullable*/String cursor, Str
* Same as {@link #getDeltaWithPathPrefix(String, String, boolean)} with {@code includeMediaInfo}
* set to {@code false}.
*/
- public DbxDelta getDeltaWithPathPrefix(/*@Nullable*/String cursor, String pathPrefix)
+ public DbxDelta getDeltaWithPathPrefix(@Nullable String cursor, String pathPrefix)
throws DbxException
{
DbxPathV1.checkArg("path", pathPrefix);
@@ -1548,7 +1548,7 @@ public DbxDelta getDeltaWithPathPrefix(/*@Nullable*/String cursor, Str
* which lets you process the delta entries as they arrive over the network.
*/
public DbxDeltaC getDeltaCWithPathPrefix(Collector, C> collector,
- /*@Nullable*/String cursor, String pathPrefix,
+ @Nullable String cursor, String pathPrefix,
boolean includeMediaInfo)
throws DbxException
{
@@ -1561,19 +1561,19 @@ public DbxDeltaC getDeltaCWithPathPrefix(Collector DbxDeltaC getDeltaCWithPathPrefix(Collector, C> collector,
- /*@Nullable*/String cursor, String pathPrefix)
+ @Nullable String cursor, String pathPrefix)
throws DbxException
{
return getDeltaCWithPathPrefix(collector, cursor, pathPrefix, false);
}
- private DbxDelta _getDelta(/*@Nullable*/String cursor, /*@Nullable*/String pathPrefix, boolean includeMediaInfo)
+ private DbxDelta _getDelta(@Nullable String cursor, @Nullable String pathPrefix, boolean includeMediaInfo)
throws DbxException
{
String host = this.host.getApi();
String apiPath = "1/delta";
- /*@Nullable*/String[] params = {
+ @Nullable String[] params = {
"cursor", cursor,
"path_prefix", pathPrefix,
"include_media_info", includeMediaInfo ? "true" : null,
@@ -1589,14 +1589,14 @@ public DbxDelta handle(HttpRequestor.Response response) throws DbxExce
}
private DbxDeltaC _getDeltaC(final Collector, C> collector,
- /*@Nullable*/String cursor, /*@Nullable*/String pathPrefix,
+ @Nullable String cursor, @Nullable String pathPrefix,
boolean includeMediaInfo)
throws DbxException
{
String host = this.host.getApi();
String apiPath = "1/delta";
- /*@Nullable*/String[] params = {
+ @Nullable String[] params = {
"cursor", cursor,
"path_prefix", pathPrefix,
"include_media_info", includeMediaInfo ? "true" : null,
@@ -1651,12 +1651,12 @@ public String getDeltaLatestCursorWithPathPrefix(String pathPrefix) throws DbxEx
return getDeltaLatestCursorWithPathPrefix(pathPrefix, false);
}
- private String _getDeltaLatestCursor(/*@Nullable*/String pathPrefix, boolean includeMediaInfo) throws DbxException
+ private String _getDeltaLatestCursor(@Nullable String pathPrefix, boolean includeMediaInfo) throws DbxException
{
String host = this.host.getApi();
String apiPath = "1/delta/latest_cursor";
- /*@Nullable*/String[] params = {
+ @Nullable String[] params = {
"path_prefix", pathPrefix,
"include_media_info", includeMediaInfo ? "true" : null,
};
@@ -1765,9 +1765,9 @@ public DbxLongpollDeltaResult handle(HttpRequestor.Response response)
* The metadata for the original file (not the thumbnail) or {@code null} if there
* is no file at that path.
*/
- public DbxEntry./*@Nullable*/File getThumbnail(
+ public DbxEntry.@Nullable File getThumbnail(
DbxThumbnailSize sizeBound, DbxThumbnailFormat format,
- String path, /*@Nullable*/String rev, OutputStream target)
+ String path, @Nullable String rev, OutputStream target)
throws DbxException, IOException
{
if (target == null) throw new IllegalArgumentException("'target' can't be null");
@@ -1781,8 +1781,8 @@ public DbxLongpollDeltaResult handle(HttpRequestor.Response response)
* Similar to {@link #getThumbnail}, except the thumbnail contents are returned via
* a {@link Downloader}.
*/
- public /*@Nullable*/Downloader startGetThumbnail(
- DbxThumbnailSize sizeBound, DbxThumbnailFormat format, String path, /*@Nullable*/String rev)
+ public @Nullable Downloader startGetThumbnail(
+ DbxThumbnailSize sizeBound, DbxThumbnailFormat format, String path, @Nullable String rev)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
@@ -1790,7 +1790,7 @@ public DbxLongpollDeltaResult handle(HttpRequestor.Response response)
if (format == null) throw new IllegalArgumentException("'format' can't be null");
String apiPath = "1/thumbnails/auto" + path;
- /*@Nullable*/String[] params = {
+ @Nullable String[] params = {
"size", sizeBound.ident,
"format", format.ident,
"rev", rev,
@@ -1823,7 +1823,7 @@ public List handle(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() != 200) throw DbxRequestUtil.unexpectedStatus(response);
- Collector> collector =
+ Collector> collector =
Collector.NullSkipper.>mk(new Collector.ArrayListCollector());
return DbxRequestUtil.readJsonFromResponse(JsonArrayReader.mk(DbxEntry.File.ReaderMaybeDeleted, collector), response);
}
@@ -1845,7 +1845,7 @@ public List handle(HttpRequestor.Response response)
* If the specified {@code path}/{@code rev} couldn't be found, return {@code null}.
* Otherwise, return metadata for the newly-created latest revision of the file.
*/
- public DbxEntry./*@Nullable*/File restoreFile(String path, String rev)
+ public DbxEntry.@Nullable File restoreFile(String path, String rev)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
@@ -1853,12 +1853,12 @@ public List handle(HttpRequestor.Response response)
if (rev.length() == 0) throw new IllegalArgumentException("'rev' can't be empty");
String apiPath = "1/restore/auto" + path;
- /*@Nullable*/String[] params = {
+ @Nullable String[] params = {
"rev", rev,
};
- return doGet(host.getApi(), apiPath, params, null, new DbxRequestUtil.ResponseHandler() {
- public DbxEntry./*@Nullable*/File handle(HttpRequestor.Response response)
+ return doGet(host.getApi(), apiPath, params, null, new DbxRequestUtil.ResponseHandler() {
+ public DbxEntry.@Nullable File handle(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() == 404) return null;
@@ -1913,7 +1913,7 @@ public List handle(HttpRequestor.Response response)
* If there is no file or folder at that path, return {@code null}. Otherwise return
* a shareable URL.
*/
- public /*@Nullable*/String createShareableUrl(String path)
+ public @Nullable String createShareableUrl(String path)
throws DbxException
{
DbxPathV1.checkArg("path", path);
@@ -1921,9 +1921,9 @@ public List handle(HttpRequestor.Response response)
String apiPath = "1/shares/auto" + path;
String[] params = {"short_url", "false"};
- return doPost(host.getApi(), apiPath, params, null, new DbxRequestUtil.ResponseHandler*@Nullable*/String>() {
+ return doPost(host.getApi(), apiPath, params, null, new DbxRequestUtil.ResponseHandler<@Nullable String>() {
@Override
- public /*@Nullable*/String handle(HttpRequestor.Response response)
+ public @Nullable String handle(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() == 404) return null;
@@ -1945,16 +1945,16 @@ public List handle(HttpRequestor.Response response)
* If there is no file at that path, return {@code null}. Otherwise return
* a shareable URL along with the expiration time.
*/
- public /*@Nullable*/DbxUrlWithExpiration createTemporaryDirectUrl(String path)
+ public @Nullable DbxUrlWithExpiration createTemporaryDirectUrl(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/media/auto" + path;
- return doPost(host.getApi(), apiPath, null, null, new DbxRequestUtil.ResponseHandler*@Nullable*/DbxUrlWithExpiration>() {
+ return doPost(host.getApi(), apiPath, null, null, new DbxRequestUtil.ResponseHandler<@Nullable DbxUrlWithExpiration>() {
@Override
- public /*@Nullable*/DbxUrlWithExpiration handle(HttpRequestor.Response response)
+ public @Nullable DbxUrlWithExpiration handle(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() == 404) return null;
@@ -1985,17 +1985,17 @@ public List handle(HttpRequestor.Response response)
* The copy ref's identifier, suitable for passing in to {@link #copyFromCopyRef},
* or {@code null} if the specified path does not exist.
*/
- public /*@Nullable*/String createCopyRef(String path)
+ public @Nullable String createCopyRef(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
String apiPath = "1/copy_ref/auto" + path;
- return doPost(host.getApi(), apiPath, null, null, new DbxRequestUtil.ResponseHandler*@Nullable*/String>()
+ return doPost(host.getApi(), apiPath, null, null, new DbxRequestUtil.ResponseHandler<@Nullable String>()
{
@Override
- public /*@Nullable*/String handle(HttpRequestor.Response response)
+ public @Nullable String handle(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() == 404) return null;
@@ -2064,7 +2064,7 @@ else if (fieldName.equals("expires")) {
* If successful, returns the metadata for new copy of the file or folder,
* otherwise returns {@code null}.
*/
- public /*@Nullable*/DbxEntry copy(String fromPath, String toPath)
+ public @Nullable DbxEntry copy(String fromPath, String toPath)
throws DbxException
{
DbxPathV1.checkArg("fromPath", fromPath);
@@ -2076,9 +2076,9 @@ else if (fieldName.equals("expires")) {
"to_path", toPath,
};
- return doPost(host.getApi(), "1/fileops/copy", params, null, new DbxRequestUtil.ResponseHandler*@Nullable*/DbxEntry>() {
+ return doPost(host.getApi(), "1/fileops/copy", params, null, new DbxRequestUtil.ResponseHandler<@Nullable DbxEntry>() {
@Override
- public /*@Nullable*/DbxEntry handle(HttpRequestor.Response response)
+ public @Nullable DbxEntry handle(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() == 403) return null;
@@ -2094,7 +2094,7 @@ else if (fieldName.equals("expires")) {
* Create a file or folder at {@code toPath} based on the given copy ref (created with
* {@link #createCopyRef}).
*/
- public /*@Nullable*/DbxEntry copyFromCopyRef(String copyRef, String toPath)
+ public @Nullable DbxEntry copyFromCopyRef(String copyRef, String toPath)
throws DbxException
{
if (copyRef == null) throw new IllegalArgumentException("'copyRef' can't be null");
@@ -2107,10 +2107,10 @@ else if (fieldName.equals("expires")) {
"to_path", toPath,
};
- return doPost(host.getApi(), "1/fileops/copy", params, null, new DbxRequestUtil.ResponseHandler*@Nullable*/DbxEntry>()
+ return doPost(host.getApi(), "1/fileops/copy", params, null, new DbxRequestUtil.ResponseHandler<@Nullable DbxEntry>()
{
@Override
- public /*@Nullable*/DbxEntry handle(HttpRequestor.Response response)
+ public @Nullable DbxEntry handle(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() != 200) throw DbxRequestUtil.unexpectedStatus(response);
@@ -2128,7 +2128,7 @@ else if (fieldName.equals("expires")) {
* If successful, returns the metadata for the newly created folder, otherwise
* returns {@code null}.
*/
- public DbxEntry./*@Nullable*/Folder createFolder(String path)
+ public DbxEntry.@Nullable Folder createFolder(String path)
throws DbxException
{
DbxPathV1.checkArgNonRoot("path", path);
@@ -2138,9 +2138,9 @@ else if (fieldName.equals("expires")) {
"path", path,
};
- return doPost(host.getApi(), "1/fileops/create_folder", params, null, new DbxRequestUtil.ResponseHandler() {
+ return doPost(host.getApi(), "1/fileops/create_folder", params, null, new DbxRequestUtil.ResponseHandler() {
@Override
- public DbxEntry./*@Nullable*/Folder handle(HttpRequestor.Response response)
+ public DbxEntry.@Nullable Folder handle(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() == 403) return null;
@@ -2181,7 +2181,7 @@ public Void handle(HttpRequestor.Response response)
* If successful, returns the metadata for the file or folder at its new location,
* otherwise returns {@code null}.
*/
- public /*@Nullable*/DbxEntry move(String fromPath, String toPath)
+ public @Nullable DbxEntry move(String fromPath, String toPath)
throws DbxException
{
DbxPathV1.checkArgNonRoot("fromPath", fromPath);
@@ -2193,10 +2193,10 @@ public Void handle(HttpRequestor.Response response)
"to_path", toPath,
};
- return doPost(host.getApi(), "1/fileops/move", params, null, new DbxRequestUtil.ResponseHandler*@Nullable*/DbxEntry>()
+ return doPost(host.getApi(), "1/fileops/move", params, null, new DbxRequestUtil.ResponseHandler<@Nullable DbxEntry>()
{
@Override
- public /*@Nullable*/DbxEntry handle(HttpRequestor.Response response)
+ public @Nullable DbxEntry handle(HttpRequestor.Response response)
throws DbxException
{
if (response.getStatusCode() == 403) return null;
@@ -2211,8 +2211,8 @@ public Void handle(HttpRequestor.Response response)
// --------------------------------------------------------
// Convenience function that calls RequestUtil.doGet with the first two parameters filled in.
- private T doGet(String host, String path, /*@Nullable*/String/*@Nullable*/[] params,
- /*@Nullable*/ArrayList headers,
+ private T doGet(String host, String path, @Nullable String @Nullable [] params,
+ @Nullable ArrayList headers,
DbxRequestUtil.ResponseHandler handler)
throws DbxException
{
@@ -2221,8 +2221,8 @@ private T doGet(String host, String path, /*@Nullable*/String/*@Nullable*/[]
// Convenience function that calls RequestUtil.doPost with the first two parameters filled in.
public T doPost(String host, String path,
- /*@Nullable*/String/*@Nullable*/[] params,
- /*@Nullable*/ArrayList headers,
+ @Nullable String @Nullable [] params,
+ @Nullable ArrayList headers,
DbxRequestUtil.ResponseHandler handler)
throws DbxException
{
diff --git a/core/src/main/java/com/dropbox/core/v1/DbxDelta.java b/core/src/main/java/com/dropbox/core/v1/DbxDelta.java
index 9ef6015a8..2ba8d00d6 100644
--- a/core/src/main/java/com/dropbox/core/v1/DbxDelta.java
+++ b/core/src/main/java/com/dropbox/core/v1/DbxDelta.java
@@ -1,5 +1,6 @@
package com.dropbox.core.v1;
+import org.checkerframework.checker.nullness.qual.Nullable;
import com.dropbox.core.json.JsonArrayReader;
import com.dropbox.core.json.JsonReadException;
import com.dropbox.core.json.JsonReader;
@@ -14,7 +15,6 @@
import java.io.IOException;
import java.util.List;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* Represents a single "page" of results from a delta-style API call.
@@ -213,13 +213,13 @@ public static final class Entry extends Dumpable
*
*
*/
- public final /*@Nullable*/MD metadata;
+ public final @Nullable MD metadata;
/**
* @param lcPath {@link #lcPath}
* @param metadata {@link #metadata}
*/
- public Entry(String lcPath, /*@Nullable*/MD metadata)
+ public Entry(String lcPath, @Nullable MD metadata)
{
this.lcPath = lcPath;
this.metadata = metadata;
@@ -269,7 +269,7 @@ public static Entry read(JsonParser parser, JsonReader
throw new JsonReadException("expecting a two-element array of [path, metadata], found a one-element array: " + jq(lcPath), arrayStart);
}
- /*@Nullable*/MD metadata;
+ @Nullable MD metadata;
try {
metadata = metadataReader.readOptional(parser);
}
diff --git a/core/src/main/java/com/dropbox/core/v1/DbxDeltaC.java b/core/src/main/java/com/dropbox/core/v1/DbxDeltaC.java
index d75a7572c..fc74f3577 100644
--- a/core/src/main/java/com/dropbox/core/v1/DbxDeltaC.java
+++ b/core/src/main/java/com/dropbox/core/v1/DbxDeltaC.java
@@ -1,5 +1,6 @@
package com.dropbox.core.v1;
+import org.checkerframework.checker.nullness.qual.Nullable;
import com.dropbox.core.json.JsonArrayReader;
import com.dropbox.core.json.JsonReadException;
import com.dropbox.core.json.JsonReader;
@@ -12,7 +13,6 @@
import java.io.IOException;
-/*>>> import checkers.nullness.quals.Nullable; */
/**
* Represents a single "page" of results from a delta-style API call. This is the more
@@ -214,13 +214,13 @@ public static final class Entry extends Dumpable
*
*
*/
- public final /*@Nullable*/MD metadata;
+ public final @Nullable MD metadata;
/**
* @param lcPath {@link #lcPath}
* @param metadata {@link #metadata}
*/
- public Entry(String lcPath, /*@Nullable*/MD metadata)
+ public Entry(String lcPath, @Nullable MD metadata)
{
this.lcPath = lcPath;
this.metadata = metadata;
@@ -270,7 +270,7 @@ public static Entry read(JsonParser parser, JsonReader
throw new JsonReadException("expecting a two-element array of [path, metadata], found a one-element array", arrayStart);
}
- /*@Nullable*/MD metadata;
+ @Nullable MD metadata;
try {
metadata = metadataReader.readOptional(parser);
}
diff --git a/core/src/main/java/com/dropbox/core/v1/DbxEntry.java b/core/src/main/java/com/dropbox/core/v1/DbxEntry.java
index 558832bd2..c61915b4d 100644
--- a/core/src/main/java/com/dropbox/core/v1/DbxEntry.java
+++ b/core/src/main/java/com/dropbox/core/v1/DbxEntry.java
@@ -1,5 +1,7 @@
package com.dropbox.core.v1;
+import org.checkerframework.checker.nullness.qual.PolyNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
import java.io.IOException;
import java.io.Serializable;
import java.util.Date;
@@ -17,8 +19,6 @@
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
-/*>>> import checkers.nullness.quals.Nullable; */
-/*>>> import checkers.nullness.quals.PolyNull; */
/**
* Holds the metadata for a Dropbox file system entry. Can either be a regular file or a folder.
@@ -165,7 +165,7 @@ public final DbxEntry.Folder read(JsonParser parser)
};
- public boolean equals(/*@Nullable*/Object o)
+ public boolean equals(@Nullable Object o)
{
return o != null && getClass().equals(o.getClass()) && equals((Folder) o);
}
@@ -233,12 +233,12 @@ public static final class File extends DbxEntry
* If this file is a photo, this may contain additional photo-related information. This field is
* only populated if you use the {@code includeMediaInfo}
*/
- public final /*@Nullable*/PhotoInfo photoInfo;
+ public final @Nullable PhotoInfo photoInfo;
/**
* Contains details about this file if it is a video
*/
- public final /*@Nullable*/VideoInfo videoInfo;
+ public final @Nullable VideoInfo videoInfo;
/**
* @param path {@link #path}
@@ -254,7 +254,7 @@ public static final class File extends DbxEntry
*/
public File(String path, String iconName, boolean mightHaveThumbnail, long numBytes, String humanSize,
Date lastModified, Date clientMtime, String rev,
- /*@Nullable*/PhotoInfo photoInfo, /*@Nullable*/VideoInfo videoInfo)
+ @Nullable PhotoInfo photoInfo, @Nullable VideoInfo videoInfo)
{
super(path, iconName, mightHaveThumbnail);
this.numBytes = numBytes;
@@ -288,7 +288,7 @@ protected void dumpFields(DumpWriter w)
}
private static void nullablePendingField(
- DumpWriter w, String fieldName, /*@Nullable*/T value, T pendingValue)
+ DumpWriter w, String fieldName, @Nullable T value, T pendingValue)
{
if (value == null) return;
@@ -322,9 +322,9 @@ public final DbxEntry.File read(JsonParser parser)
};
- public static final JsonReader ReaderMaybeDeleted = new JsonReader()
+ public static final JsonReader ReaderMaybeDeleted = new JsonReader()
{
- public final DbxEntry./*@Nullable*/File read(JsonParser parser)
+ public final DbxEntry.@Nullable File read(JsonParser parser)
throws IOException, JsonReadException
{
JsonLocation top = parser.getCurrentLocation();
@@ -339,7 +339,7 @@ public final DbxEntry.File read(JsonParser parser)
};
- public boolean equals(/*@Nullable*/Object o)
+ public boolean equals(@Nullable Object o)
{
return o != null && getClass().equals(o.getClass()) && equals((File) o);
}
@@ -378,14 +378,14 @@ public static final class PhotoInfo extends Dumpable
/**
* When the photo was taken.
*/
- public final /*@Nullable*/Date timeTaken;
+ public final @Nullable Date timeTaken;
/**
* Where the photo was taken.
*/
- public final /*@Nullable*/Location location;
+ public final @Nullable Location location;
- public PhotoInfo(/*@Nullable*/Date timeTaken, /*@Nullable*/Location location) {
+ public PhotoInfo(@Nullable Date timeTaken, @Nullable Location location) {
this.timeTaken = timeTaken;
this.location = location;
}
@@ -425,7 +425,7 @@ protected void dumpFields(DumpWriter w)
}
@Override
- public boolean equals(/*@Nullable*/Object o)
+ public boolean equals(@Nullable Object o)
{
return o != null && getClass().equals(o.getClass()) && equals((PhotoInfo) o);
}
@@ -457,19 +457,19 @@ public static final class VideoInfo extends Dumpable
/**
* When the video was recorded.
*/
- public final /*@Nullable*/Date timeTaken;
+ public final @Nullable Date timeTaken;
/**
* Where the video was recorded.
*/
- public final /*@Nullable*/Location location;
+ public final @Nullable Location location;
/**
* The duration of the video, in seconds.
*/
- public final /*@Nullable*/Long duration;
+ public final @Nullable Long duration;
- public VideoInfo(/*@Nullable*/Date timeTaken, /*@Nullable*/Location location, /*@Nullable*/Long duration)
+ public VideoInfo(@Nullable Date timeTaken, @Nullable Location location, @Nullable Long duration)
{
this.timeTaken = timeTaken;
this.location = location;
@@ -518,7 +518,7 @@ protected void dumpFields(DumpWriter w)
}
@Override
- public boolean equals(/*@Nullable*/Object o)
+ public boolean equals(@Nullable Object o)
{
return o != null && getClass().equals(o.getClass()) && equals((VideoInfo) o);
}
@@ -557,10 +557,10 @@ public Location(double latitude, double longitude) {
this.longitude = longitude;
}
- public static JsonReader*@Nullable*/Location> Reader = new JsonReader*@Nullable*/Location>()
+ public static JsonReader<@Nullable Location> Reader = new JsonReader<@Nullable Location>()
{
@Override
- public /*@Nullable*/Location read(JsonParser parser)
+ public @Nullable Location read(JsonParser parser)
throws IOException, JsonReadException
{
Location location = null;
@@ -597,7 +597,7 @@ public int hashCode() {
}
@Override
- public boolean equals(/*@Nullable*/Object o) {
+ public boolean equals(@Nullable Object o) {
return o != null && getClass().equals(o.getClass()) && equals((Location) o);
}
@@ -622,9 +622,9 @@ public final DbxEntry read(JsonParser parser)
}
};
- public static final JsonReader*@Nullable*/DbxEntry> ReaderMaybeDeleted = new JsonReader*@Nullable*/DbxEntry>()
+ public static final JsonReader<@Nullable DbxEntry> ReaderMaybeDeleted = new JsonReader<@Nullable DbxEntry>()
{
- public final /*@Nullable*/DbxEntry read(JsonParser parser)
+ public final @Nullable DbxEntry read(JsonParser parser)
throws IOException, JsonReadException
{
WithChildrenC> wc = DbxEntry.readMaybeDeleted(parser, null);
@@ -654,20 +654,20 @@ public static final class WithChildren extends Dumpable implements Serializable
* contents. This value can be used with {@link DbxClientV1#getMetadataWithChildrenIfChanged}
* to void downloading the folder contents if they havne't changed.
*/
- public final /*@PolyNull*/String hash;
+ public final @PolyNull String hash;
/**
* If {@link #entry} is a folder, this will contain the metadata of the folder's
* immediate children. If it's not a folder, this will be {@code null}.
*/
- public final /*@PolyNull*/List children;
+ public final @PolyNull List children;
/**
* @param entry {@link #entry}
* @param hash {@link #hash}
* @param children {@link #children}
*/
- public WithChildren(DbxEntry entry, /*@PolyNull*/String hash, /*@PolyNull*/List children)
+ public WithChildren(DbxEntry entry, @PolyNull String hash, @PolyNull List children)
{
this.entry = entry;
this.hash = hash;
@@ -684,9 +684,9 @@ public final WithChildren read(JsonParser parser)
}
};
- public static final JsonReader*@Nullable*/WithChildren> ReaderMaybeDeleted = new JsonReader*@Nullable*/WithChildren>()
+ public static final JsonReader<@Nullable WithChildren> ReaderMaybeDeleted = new JsonReader<@Nullable WithChildren>()
{
- public final /*@Nullable*/WithChildren read(JsonParser parser)
+ public final @Nullable WithChildren read(JsonParser parser)
throws IOException, JsonReadException
{
WithChildrenC> c = DbxEntry.>readMaybeDeleted(parser, new Collector.ArrayListCollector());
@@ -695,7 +695,7 @@ public final WithChildren read(JsonParser parser)
}
};
- public boolean equals(/*@Nullable*/Object o)
+ public boolean equals(@Nullable Object o)
{
return o != null && getClass().equals(o.getClass()) && equals((WithChildren) o);
}
@@ -745,20 +745,20 @@ public static final class WithChildrenC extends Dumpable implements Serializa
* contents. This value can be used with {@link DbxClientV1#getMetadataWithChildrenIfChanged}
* to void downloading the folder contents if they havne't changed.
*/
- public final /*@PolyNull*/String hash;
+ public final @PolyNull String hash;
/**
* If {@link #entry} is a folder, this will contain the metadata of the folder's
* immediate children. If it's not a folder, this will be {@code null}.
*/
- public final /*@PolyNull*/C children;
+ public final @PolyNull C children;
/**
* @param entry {@link #entry}
* @param hash {@link #hash}
* @param children {@link #children}
*/
- public WithChildrenC(DbxEntry entry, /*@PolyNull*/String hash, /*@PolyNull*/C children)
+ public WithChildrenC(DbxEntry entry, @PolyNull String hash, @PolyNull C children)
{
this.entry = entry;
this.hash = hash;
@@ -777,12 +777,12 @@ public final WithChildrenC read(JsonParser parser)
}
}
- public static class ReaderMaybeDeleted extends JsonReader*@Nullable*/WithChildrenC>
+ public static class ReaderMaybeDeleted extends JsonReader<@Nullable WithChildrenC>
{
private final Collector collector;
public ReaderMaybeDeleted(Collector collector) { this.collector = collector; }
- public final /*@Nullable*/WithChildrenC read(JsonParser parser)
+ public final @Nullable WithChildrenC read(JsonParser parser)
throws IOException, JsonReadException
{
return DbxEntry.readMaybeDeleted(parser, collector);
@@ -790,7 +790,7 @@ public static class ReaderMaybeDeleted extends JsonReader*@Nullable*/WithCh
}
@Override
- public boolean equals(/*@Nullable*/Object o)
+ public boolean equals(@Nullable Object o)
{
return o != null && getClass().equals(o.getClass()) && equals((WithChildrenC) o);
}
@@ -825,13 +825,13 @@ protected void dumpFields(DumpWriter w)
}
}
- public static /*@Nullable*/WithChildrenC readMaybeDeleted(JsonParser parser, /*@Nullable*/Collector collector)
+ public static @Nullable WithChildrenC readMaybeDeleted(JsonParser parser, @Nullable Collector collector)
throws IOException, JsonReadException
{
return _read(parser, collector, true);
}
- public static WithChildrenC read(JsonParser parser, /*@Nullable*/Collector collector)
+ public static WithChildrenC read(JsonParser parser, @Nullable Collector collector)
throws IOException, JsonReadException
{
WithChildrenC r = _read(parser, collector, false);
@@ -843,7 +843,7 @@ public static WithChildrenC