提交 05486aee 编写于 作者: E Eric Frohnhoefer

Bump gradle version 3.3 -> 4.2.1

* Update checkstyle rules

Change-Id: Ieb03a2b9894b6530fb269cb46f70a11fffc5843f
上级 b8e2794a
......@@ -34,6 +34,6 @@ subprojects { Project subproject ->
}
task wrapper(type: Wrapper) {
gradleVersion = '3.3'
gradleVersion = '4.2.1'
}
......@@ -20,4 +20,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip
......@@ -44,7 +44,7 @@ class FileUtils {
final String[] parts = documentId.split(":");
final String type = parts[0];
Uri contentUri;
final Uri contentUri;
if ("image".equals(type)) {
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else {
......
......@@ -29,7 +29,7 @@ import java.util.List;
class ScribeClientImpl implements ScribeClient {
private final DefaultScribeClient scribeClient;
public ScribeClientImpl(DefaultScribeClient scribeClient) {
ScribeClientImpl(DefaultScribeClient scribeClient) {
this.scribeClient = scribeClient;
}
......
......@@ -52,7 +52,7 @@ class FilterTimelineDelegate extends TimelineDelegate<Tweet> {
* @param timelineFilter a timelineFilter for filtering tweets from timeline
* @throws java.lang.IllegalArgumentException if timeline is null
*/
public FilterTimelineDelegate(Timeline<Tweet> timeline, TimelineFilter timelineFilter) {
FilterTimelineDelegate(Timeline<Tweet> timeline, TimelineFilter timelineFilter) {
super(timeline);
this.timelineFilter = timelineFilter;
this.tweetUi = TweetUi.getInstance();
......
......@@ -47,7 +47,7 @@ class TimelineDelegate<T extends Identifiable> {
* @param timeline Timeline source
* @throws java.lang.IllegalArgumentException if timeline is null
*/
public TimelineDelegate(Timeline<T> timeline) {
TimelineDelegate(Timeline<T> timeline) {
this(timeline, null, null);
}
......
......@@ -38,7 +38,7 @@ abstract class TimelineListAdapter<T extends Identifiable> extends BaseAdapter {
* @param timeline a Timeline providing access to timeline data items.
* @throws java.lang.IllegalArgumentException if context or timeline is null
*/
public TimelineListAdapter(Context context, Timeline<T> timeline) {
TimelineListAdapter(Context context, Timeline<T> timeline) {
this(context, new TimelineDelegate<>(timeline));
}
......
......@@ -31,12 +31,12 @@ class TimelineStateHolder {
// true while a request is in flight, false otherwise
public final AtomicBoolean requestInFlight = new AtomicBoolean(false);
public TimelineStateHolder() {
TimelineStateHolder() {
// intentionally blank
}
/* for testing */
public TimelineStateHolder(TimelineCursor nextCursor, TimelineCursor previousCursor) {
TimelineStateHolder(TimelineCursor nextCursor, TimelineCursor previousCursor) {
this.nextCursor = nextCursor;
this.previousCursor = previousCursor;
}
......
......@@ -92,8 +92,7 @@ public class TweetTimelineListAdapter extends TimelineListAdapter<Tweet> {
private void scribeTimelineImpression() {
final String jsonMessage;
if (delegate instanceof FilterTimelineDelegate) {
final FilterTimelineDelegate filterTimelineDelegate = (
FilterTimelineDelegate) delegate;
final FilterTimelineDelegate filterTimelineDelegate = (FilterTimelineDelegate) delegate;
final TimelineFilter timelineFilter = filterTimelineDelegate.timelineFilter;
jsonMessage = getJsonMessage(timelineFilter.totalFilters());
} else {
......
......@@ -157,8 +157,8 @@ public class TweetTimelineRecyclerViewAdapter extends
private void scribeTimelineImpression() {
final String jsonMessage;
if (timelineDelegate instanceof FilterTimelineDelegate) {
final FilterTimelineDelegate filterTimelineDelegate = (
FilterTimelineDelegate) timelineDelegate;
final FilterTimelineDelegate filterTimelineDelegate =
(FilterTimelineDelegate) timelineDelegate;
final TimelineFilter timelineFilter = filterTimelineDelegate.timelineFilter;
jsonMessage = getJsonMessage(timelineFilter.totalFilters());
} else {
......
......@@ -125,7 +125,7 @@ public final class TweetUtils {
return null;
}
String permalink;
final String permalink;
if (TextUtils.isEmpty(screenName)) {
permalink = String.format(Locale.US, TWEET_URL, UNKNOWN_SCREEN_NAME, tweetId);
} else {
......@@ -140,7 +140,7 @@ public final class TweetUtils {
* @return Can be null, otherwise a resolvable permalink to a Profile.
*/
static String getProfilePermalink(String screenName) {
String permalink;
final String permalink;
if (TextUtils.isEmpty(screenName)) {
permalink = String.format(Locale.US, PROFILE_URL, UNKNOWN_SCREEN_NAME);
} else {
......
......@@ -70,8 +70,8 @@ public class AspectRatioFrameLayout extends FrameLayout {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width;
int height;
final int width;
final int height;
final int horizontalPadding = getPaddingLeft() + getPaddingRight();
final int verticalPadding = getPaddingBottom() + getPaddingTop();
......
......@@ -150,7 +150,7 @@ public class TimelineListAdapterTest {
* @param <T>
*/
class TestTimelineDelegate<T extends Identifiable> extends TimelineDelegate {
public TestTimelineDelegate(Timeline<T> timeline) {
TestTimelineDelegate(Timeline<T> timeline) {
super(timeline);
}
}
......
......@@ -97,11 +97,11 @@ public class ClickableLinkSpanTest {
}
private static class TestClickableLinkSpan extends ClickableLinkSpan {
public TestClickableLinkSpan(int selectedColor) {
TestClickableLinkSpan(int selectedColor) {
super(selectedColor, 0, false, false);
}
public TestClickableLinkSpan(int selectedColor, int linkColor, boolean underlined) {
TestClickableLinkSpan(int selectedColor, int linkColor, boolean underlined) {
super(selectedColor, linkColor, true, underlined);
}
......
......@@ -31,7 +31,7 @@ class TwitterContext extends ContextWrapper {
private final String componentPath;
private final String componentName;
public TwitterContext(Context base, String componentName, String componentPath) {
TwitterContext(Context base, String componentName, String componentPath) {
super(base);
this.componentName = componentName;
this.componentPath = componentPath;
......
......@@ -76,7 +76,7 @@ public class TwitterSession extends Session<TwitterAuthToken> {
private final Gson gson;
public Serializer() {
Serializer() {
this.gson = new Gson();
}
......
......@@ -33,7 +33,7 @@ class OAuthHandler extends AuthHandler {
* @param authConfig The {@link com.twitter.sdk.android.core.TwitterAuthConfig}.
* @param callback The listener to callback when authorization completes.
*/
public OAuthHandler(TwitterAuthConfig authConfig, Callback<TwitterSession> callback,
OAuthHandler(TwitterAuthConfig authConfig, Callback<TwitterSession> callback,
int requestCode) {
super(authConfig, callback, requestCode);
}
......
......@@ -39,7 +39,7 @@ class OAuthWebViewClient extends WebViewClient {
private final String completeUrl;
private final Listener listener;
public OAuthWebViewClient(String completeUrl, Listener listener) {
OAuthWebViewClient(String completeUrl, Listener listener) {
this.completeUrl = completeUrl;
this.listener = listener;
}
......
......@@ -90,7 +90,7 @@ class SSOAuthHandler extends AuthHandler {
private static final String EXTRA_CONSUMER_KEY = "ck";
private static final String EXTRA_CONSUMER_SECRET = "cs";
public SSOAuthHandler(TwitterAuthConfig authConfig, Callback<TwitterSession> callback,
SSOAuthHandler(TwitterAuthConfig authConfig, Callback<TwitterSession> callback,
int requestCode) {
super(authConfig, callback, requestCode);
}
......@@ -156,7 +156,7 @@ class SSOAuthHandler extends AuthHandler {
private static boolean checkAppSignature(PackageManager pm, String packageName,
String requiredSignature) {
PackageInfo p;
final PackageInfo p;
try {
p = pm.getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
} catch (PackageManager.NameNotFoundException e) {
......
......@@ -26,7 +26,7 @@ class WebViewException extends Exception {
private final int errorCode;
private final String failingUrl;
public WebViewException(int errorCode, String description, String failingUrl) {
WebViewException(int errorCode, String description, String failingUrl) {
super(description);
this.errorCode = errorCode;
this.failingUrl = failingUrl;
......
......@@ -24,7 +24,7 @@ class GuestTokenResponse {
@SerializedName("guest_token")
public final String guestToken;
public GuestTokenResponse(String guestToken) {
GuestTokenResponse(String guestToken) {
this.guestToken = guestToken;
}
}
......@@ -54,7 +54,7 @@ class OAuth1aParameters {
private final String url;
private final Map<String, String> postParams;
public OAuth1aParameters(TwitterAuthConfig authConfig, TwitterAuthToken authToken,
OAuth1aParameters(TwitterAuthConfig authConfig, TwitterAuthToken authToken,
String callback, String method, String url, Map<String, String> postParams) {
this.authConfig = authConfig;
this.authToken = authToken;
......
......@@ -25,7 +25,7 @@ class EnabledScribeStrategy extends EnabledEventsStrategy<ScribeEvent> {
private final FilesSender filesSender;
public EnabledScribeStrategy(Context context, ScheduledExecutorService executorService,
EnabledScribeStrategy(Context context, ScheduledExecutorService executorService,
ScribeFilesManager filesManager, ScribeConfig config, ScribeFilesSender filesSender) {
super(context, executorService, filesManager);
this.filesSender = filesSender;
......
......@@ -66,7 +66,7 @@ public abstract class EventsFilesManager<T> {
* {@link #getMaxFilesToKeep()}
* @throws IOException
*/
public EventsFilesManager(Context context, EventTransform<T> transform,
EventsFilesManager(Context context, EventTransform<T> transform,
CurrentTimeProvider currentTimeProvider, EventsStorage eventStorage,
int defaultMaxFilesToKeep)
throws IOException {
......@@ -245,7 +245,7 @@ public abstract class EventsFilesManager<T> {
final File file;
final long timestamp;
public FileWithTimestamp(File file, long timestamp) {
FileWithTimestamp(File file, long timestamp) {
this.file = file;
this.timestamp = timestamp;
}
......
......@@ -29,7 +29,7 @@ class ScribeFilesManager extends EventsFilesManager<ScribeEvent> {
static final String FILE_PREFIX = "se";
static final String FILE_EXTENSION = ".tap";
public ScribeFilesManager(Context context, EventTransform<ScribeEvent> transform,
ScribeFilesManager(Context context, EventTransform<ScribeEvent> transform,
CurrentTimeProvider currentTimeProvider,
QueueFileEventStorage eventsStorage, int defaultMaxFilesToKeep
) throws IOException {
......
......@@ -79,7 +79,7 @@ class ScribeFilesSender implements FilesSender {
private final ExecutorService executorService;
private final IdManager idManager;
public ScribeFilesSender(Context context, ScribeConfig scribeConfig, long ownerId,
ScribeFilesSender(Context context, ScribeConfig scribeConfig, long ownerId,
TwitterAuthConfig authConfig,
SessionManager<? extends Session<TwitterAuthToken>> sessionManager,
GuestSessionProvider guestSessionProvider, ExecutorService executorService,
......@@ -173,7 +173,7 @@ class ScribeFilesSender implements FilesSender {
synchronized ScribeService getScribeService() {
if (scribeService.get() == null) {
final Session session = getSession(ownerId);
OkHttpClient client;
final OkHttpClient client;
if (isValidSession(session)) {
client = new OkHttpClient.Builder()
.certificatePinner(OkHttpClientHelper.getCertificatePinner())
......
......@@ -23,7 +23,7 @@ import java.util.concurrent.ScheduledExecutorService;
class ScribeHandler extends EventsHandler<ScribeEvent> {
public ScribeHandler(Context context, EventsStrategy<ScribeEvent> strategy,
ScribeHandler(Context context, EventsStrategy<ScribeEvent> strategy,
EventsFilesManager filesManager, ScheduledExecutorService executorService) {
super(context, strategy, filesManager, executorService);
}
......
......@@ -37,7 +37,7 @@ class Entity implements Serializable {
@SerializedName("indices")
public final List<Integer> indices;
public Entity(int start, int end) {
Entity(int start, int end) {
final List<Integer> temp = new ArrayList<>(2);
temp.add(START_INDEX, start);
temp.add(END_INDEX, end);
......
......@@ -188,7 +188,7 @@ public class AuthTokenAdapterTest {
private static class AuthTokenWrapper {
final AuthToken authToken;
public AuthTokenWrapper(AuthToken authToken) {
AuthTokenWrapper(AuthToken authToken) {
this.authToken = authToken;
}
}
......
......@@ -68,7 +68,7 @@ public class OAuth1aHeadersTest {
}
private class MockOAuth1aParameters extends OAuth1aParameters {
public MockOAuth1aParameters() {
MockOAuth1aParameters() {
super(null, null, null, null, null, null);
}
......
......@@ -48,7 +48,7 @@ public class OAuth1aParametersTest {
public final String expectedSignature;
public final String expectedAuthHeader;
public TestParameters(String method, String url, Map<String, String> postParams,
TestParameters(String method, String url, Map<String, String> postParams,
String consumerKey, String consumerSecret, String callback, String nonce,
String timestamp, String token, String tokenSecret,
String expectedSignatureBase, String expectedSignature,
......
......@@ -91,7 +91,7 @@ public class EventsHandlerTest {
}
class MockEventsHandler extends EventsHandler<Object> {
public MockEventsHandler(Context context, EventsStrategy<Object> strategy,
MockEventsHandler(Context context, EventsStrategy<Object> strategy,
EventsFilesManager filesManager,
ScheduledExecutorService executor) {
super(context, strategy, filesManager, executor);
......
......@@ -99,7 +99,7 @@ public class SafeListAdapterTest {
public final List<Integer> listOfIntegers;
// Not used in testing, but needed because of final.
public Model1(List<Integer> listOfLongs) {
Model1(List<Integer> listOfLongs) {
this.listOfIntegers = listOfLongs;
}
}
......@@ -110,7 +110,7 @@ public class SafeListAdapterTest {
public final List<Long> listOfLongs;
// Not used in testing, but needed because of final.
public Model2(List<Long> listOfLongs) {
Model2(List<Long> listOfLongs) {
this.listOfLongs = listOfLongs;
}
}
......
......@@ -89,7 +89,7 @@ public class SafeMapAdapterTest {
public final Map<String, String> mapOfStrings;
// Not used in testing, but needed because of final.
public Model1(Map<String, String> mapOfStrings) {
Model1(Map<String, String> mapOfStrings) {
this.mapOfStrings = mapOfStrings;
}
}
......@@ -100,9 +100,8 @@ public class SafeMapAdapterTest {
public final Map<String, Long> stringLongMap;
// Not used in testing, but needed because of final.
public Model2(Map<String, Long> stringLongMap) {
Model2(Map<String, Long> stringLongMap) {
this.stringLongMap = stringLongMap;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册