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

Used google-java-formatter and added plugin #619

Merged
merged 1 commit into from
Mar 19, 2019
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
Expand Up @@ -19,7 +19,7 @@
import com.google.api.client.util.Preconditions;

/**
* {@link Beta} <br/>
* {@link Beta} <br>
* Utilities for Android.
*
* @since 1.11
Expand All @@ -44,11 +44,12 @@ public static boolean isMinimumSdkLevel(int minimumSdkLevel) {
* @see android.os.Build.VERSION_CODES
*/
public static void checkMinimumSdkLevel(int minimumSdkLevel) {
Preconditions.checkArgument(isMinimumSdkLevel(minimumSdkLevel),
"running on Android SDK level %s but requires minimum %s", Build.VERSION.SDK_INT,
Preconditions.checkArgument(
isMinimumSdkLevel(minimumSdkLevel),
"running on Android SDK level %s but requires minimum %s",
Build.VERSION.SDK_INT,
minimumSdkLevel);
}

private AndroidUtils() {
}
private AndroidUtils() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@
import com.google.api.client.http.apache.ApacheHttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.util.Beta;

import java.net.HttpURLConnection;

/**
* {@link Beta} <br/>
* {@link Beta} <br>
* Utilities for Android HTTP transport.
*
* @since 1.11
* @author Yaniv Inbar
* @deprecated Gingerbread is no longer supported by Google Play Services. Please use
* {@link NetHttpTransport} directly or switch to Cronet which is better supported.
* @deprecated Gingerbread is no longer supported by Google Play Services. Please use {@link
* NetHttpTransport} directly or switch to Cronet which is better supported.
*/
@Beta
@Deprecated
Expand All @@ -39,24 +38,19 @@ public class AndroidHttp {
* Returns a new thread-safe HTTP transport instance that is compatible with Android SDKs prior to
* Gingerbread.
*
* <p>
* Don't use this for Android applications that anyway require Gingerbread. Instead just call
* <p>Don't use this for Android applications that anyway require Gingerbread. Instead just call
* {@code new NetHttpTransport()}.
* </p>
*
* <p>
* Prior to Gingerbread, the {@link HttpURLConnection} implementation was buggy, and the Apache
* <p>Prior to Gingerbread, the {@link HttpURLConnection} implementation was buggy, and the Apache
* HTTP Client was preferred. However, starting with Gingerbread, the {@link HttpURLConnection}
* implementation bugs were fixed, and is now better supported than the Apache HTTP Client. There
* is no guarantee that Apache HTTP transport will continue to work in future SDKs. Therefore,
* this method uses {@link NetHttpTransport} for Gingerbread or higher, and otherwise
* {@link ApacheHttpTransport}.
* </p>
* this method uses {@link NetHttpTransport} for Gingerbread or higher, and otherwise {@link
* ApacheHttpTransport}.
*/
public static HttpTransport newCompatibleTransport() {
return AndroidUtils.isMinimumSdkLevel(9) ? new NetHttpTransport() : new ApacheHttpTransport();
}

private AndroidHttp() {
}
private AndroidHttp() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

/**
* {@link com.google.api.client.util.Beta} <br/>
* {@link com.google.api.client.util.Beta} <br>
* Utilities for Android HTTP transport.
*
* @since 1.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,13 @@
import java.nio.charset.Charset;

/**
* {@link Beta} <br/>
* {@link Beta} <br>
* Low-level JSON library implementation based on GSON.
*
* <p>
* Implementation is thread-safe, and sub-classes must be thread-safe. For maximum efficiency,
* <p>Implementation is thread-safe, and sub-classes must be thread-safe. For maximum efficiency,
* applications should use a single globally-shared instance of the JSON factory.
* </p>
*
* <p>
* Required minimum Android SDK 3.0 (level 11).
* </p>
* <p>Required minimum Android SDK 3.0 (level 11).
*
* @since 1.11
* @author Yaniv Inbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@
import java.math.BigInteger;

/**
* {@link Beta} <br/>
* {@link Beta} <br>
* Low-level JSON serializer implementation based on GSON.
*
* <p>
* Implementation is not thread-safe.
* </p>
* <p>Implementation is not thread-safe.
*
* @author Yaniv Inbar
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@
import java.util.List;

/**
* {@link Beta} <br/>
* {@link Beta} <br>
* Low-level JSON serializer implementation based on GSON.
*
* <p>
* Implementation is not thread-safe.
* </p>
* <p>Implementation is not thread-safe.
*
* @author Yaniv Inbar
*/
Expand Down Expand Up @@ -87,7 +85,6 @@ public short getShortValue() {
return Short.parseShort(currentText);
}


@Override
public int getIntValue() {
checkNumber();
Expand Down Expand Up @@ -199,8 +196,10 @@ public JsonToken nextToken() throws IOException {
break;
case NUMBER:
currentText = reader.nextString();
currentToken = currentText.indexOf('.') == -1
? JsonToken.VALUE_NUMBER_INT : JsonToken.VALUE_NUMBER_FLOAT;
currentToken =
currentText.indexOf('.') == -1
? JsonToken.VALUE_NUMBER_INT
: JsonToken.VALUE_NUMBER_FLOAT;
break;
case NAME:
currentText = reader.nextName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

/**
* {@link com.google.api.client.util.Beta} <br/>
* {@link com.google.api.client.util.Beta} <br>
* Low-level implementation of the GSON parser library built-in to the Android 3.0 SDK.
*
* @since 1.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

/**
* {@link com.google.api.client.util.Beta} <br/>
* {@link com.google.api.client.util.Beta} <br>
* Utilities for Android.
*
* @since 1.11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;

/**
* @author Yaniv Inbar
*/
/** @author Yaniv Inbar */
final class ApacheHttpRequest extends LowLevelHttpRequest {
private final HttpClient httpClient;

Expand All @@ -54,7 +52,8 @@ public void setTimeout(int connectTimeout, int readTimeout) throws IOException {
@Override
public LowLevelHttpResponse execute() throws IOException {
if (getStreamingContent() != null) {
Preconditions.checkArgument(request instanceof HttpEntityEnclosingRequest,
Preconditions.checkArgument(
request instanceof HttpEntityEnclosingRequest,
"Apache HTTP client does not support %s requests with content.",
request.getRequestLine().getMethod());
ContentEntity entity = new ContentEntity(getContentLength(), getStreamingContent());
Expand Down
Loading