提交 6fa3b709 编写于 作者: E Eric Frohnhoefer

Cleanup code

* Remove unnecessary casts for findViewById, etc
* Remove unnecessary semicolons in gradle scripts

Change-Id: Ie45733fe034c0f7c6a36dd2519fd87943181917b
上级 fdc1b851
......@@ -9,7 +9,7 @@ Properties props = new Properties()
try {
props.load(file('twitter.properties').newDataInputStream())
} catch (Exception ex) {
throw new GradleException("Missing twitter.properties, check the twitter.properties.sample file.");
throw new GradleException("Missing twitter.properties, check the twitter.properties.sample file.")
}
apply plugin: 'com.android.application'
......
......@@ -18,7 +18,7 @@ if (propsFile.exists()) {
props.setProperty("twitterConsumerKey", System.env.TWITTER_KEY)
props.setProperty("twitterConsumerSecret", System.env.TWITTER_SECRET)
} else {
throw new GradleException("Missing twitter.properties, check the twitter.properties.sample file.");
throw new GradleException("Missing twitter.properties, check the twitter.properties.sample file.")
}
apply plugin: 'com.android.application'
......
......@@ -70,13 +70,13 @@ public class XmlTweetActivityTest extends ActivityInstrumentationTestCase2<XmlTw
}
private void findViews() {
jackTweet = (TweetView) activity.findViewById(R.id.jack_regular_tweet);
jackCompactTweet = (CompactTweetView) activity.findViewById(R.id.jack_compact_tweet);
bikeTweet = (TweetView) activity.findViewById(R.id.bike_regular_tweet);
bikeCompactTweet = (CompactTweetView) activity.findViewById(R.id.bike_compact_tweet);
simpsonsRetweet = (TweetView) activity.findViewById(R.id.retweet_simpsons_tweet);
jackTweet = activity.findViewById(R.id.jack_regular_tweet);
jackCompactTweet = activity.findViewById(R.id.jack_compact_tweet);
bikeTweet = activity.findViewById(R.id.bike_regular_tweet);
bikeCompactTweet = activity.findViewById(R.id.bike_compact_tweet);
simpsonsRetweet = activity.findViewById(R.id.retweet_simpsons_tweet);
simpsonsCompactRetweet
= (CompactTweetView) activity.findViewById(R.id.retweet_simpsons_compact_tweet);
= activity.findViewById(R.id.retweet_simpsons_compact_tweet);
}
public void testTweetView() throws Exception {
......
......@@ -36,7 +36,7 @@ public class BaseActivity extends AppCompatActivity {
* @return The Toolbar view or null if not found.
*/
protected Toolbar setupToolbar() {
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
final Toolbar toolbar = findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
}
......
......@@ -50,7 +50,7 @@ public class TweetComposerMainActivity extends BaseActivity {
actionBar.setTitle(R.string.kit_tweetcomposer);
}
final Button tweetComposer = (Button) findViewById(R.id.tweet_composer);
final Button tweetComposer = findViewById(R.id.tweet_composer);
tweetComposer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
......@@ -66,7 +66,7 @@ public class TweetComposerMainActivity extends BaseActivity {
}
});
final Button organicComposer = (Button) findViewById(R.id.organic_composer);
final Button organicComposer = findViewById(R.id.organic_composer);
organicComposer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
......
......@@ -70,9 +70,9 @@ public class TimelineActivity extends BaseActivity {
}
};
final SwipeRefreshLayout swipeLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout);
final SwipeRefreshLayout swipeLayout = findViewById(R.id.swipe_layout);
final View emptyView = findViewById(android.R.id.empty);
final ListView listView = (ListView) findViewById(android.R.id.list);
final ListView listView = findViewById(android.R.id.list);
listView.setEmptyView(emptyView);
final SearchTimeline timeline = new SearchTimeline.Builder().query("#twitter").build();
......
......@@ -45,10 +45,10 @@ public class TimelinesActivity extends AppCompatActivity {
final FragmentManager fm = getSupportFragmentManager();
final FragmentPagerAdapter pagerAdapter = new TimelinePagerAdapter(fm, getResources());
final ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
final ViewPager viewPager = findViewById(R.id.pager);
viewPager.setAdapter(pagerAdapter);
final TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout);
final TabLayout tabLayout = findViewById(R.id.tab_layout);
tabLayout.setupWithViewPager(viewPager);
}
......
......@@ -88,7 +88,7 @@ public class TweetActivity extends TweetUiActivity {
Bundle savedInstanceState) {
final View v = inflater.inflate(R.layout.tweetui_fragment_tweet, container, false);
final ViewGroup tweetRegion = (ViewGroup) v.findViewById(R.id.tweet_region);
final ViewGroup tweetRegion = v.findViewById(R.id.tweet_region);
// load single Tweets and construct TweetViews
loadTweet(20L, tweetRegion, R.id.jack_regular_tweet);
......
......@@ -79,10 +79,10 @@ public class TweetPreviewActivity extends TweetUiActivity {
final View v = inflater.inflate(R.layout.tweetui_fragment_tweet_preview, container,
false);
final ViewGroup tweetRegion = (ViewGroup) v.findViewById(R.id.tweet_region);
final EditText selectorInput = (EditText) v.findViewById(R.id.selector_input_tweet_id);
final Button lightButton = (Button) v.findViewById(R.id.button_show_light);
final Button darkButton = (Button) v.findViewById(R.id.button_show_dark);
final ViewGroup tweetRegion = v.findViewById(R.id.tweet_region);
final EditText selectorInput = v.findViewById(R.id.selector_input_tweet_id);
final Button lightButton = v.findViewById(R.id.button_show_light);
final Button darkButton = v.findViewById(R.id.button_show_dark);
lightButton.setOnClickListener(new View.OnClickListener() {
@Override
......
......@@ -37,7 +37,7 @@ public class TweetUiMainActivity extends BaseActivity {
actionBar.setTitle(R.string.kit_tweetui);
}
final Button xmlTweetButton = (Button) findViewById(R.id.button_xml_tweet_activity);
final Button xmlTweetButton = findViewById(R.id.button_xml_tweet_activity);
xmlTweetButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -45,7 +45,7 @@ public class TweetUiMainActivity extends BaseActivity {
}
});
final Button tweetActivityButton = (Button) findViewById(R.id.button_tweet_activity);
final Button tweetActivityButton = findViewById(R.id.button_tweet_activity);
tweetActivityButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -53,7 +53,7 @@ public class TweetUiMainActivity extends BaseActivity {
}
});
final Button unqiueTweetButton = (Button) findViewById(R.id.button_unique_tweet_activity);
final Button unqiueTweetButton = findViewById(R.id.button_unique_tweet_activity);
unqiueTweetButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -61,7 +61,7 @@ public class TweetUiMainActivity extends BaseActivity {
}
});
final Button tweetListButton = (Button) findViewById(R.id.button_fixed_timeline_activity);
final Button tweetListButton = findViewById(R.id.button_fixed_timeline_activity);
tweetListButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -69,7 +69,7 @@ public class TweetUiMainActivity extends BaseActivity {
}
});
final Button timelineButton = (Button) findViewById(R.id.button_refresh_timeline_activity);
final Button timelineButton = findViewById(R.id.button_refresh_timeline_activity);
timelineButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......@@ -77,7 +77,7 @@ public class TweetUiMainActivity extends BaseActivity {
}
});
final Button timelinesButton = (Button) findViewById(R.id.button_timelines_activity);
final Button timelinesButton = findViewById(R.id.button_timelines_activity);
timelinesButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
......@@ -85,7 +85,7 @@ public class TweetUiMainActivity extends BaseActivity {
}
});
final Button tweetSelectorButton = (Button) findViewById(
final Button tweetSelectorButton = findViewById(
R.id.button_tweet_preview_activity);
tweetSelectorButton.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -94,7 +94,7 @@ public class TweetUiMainActivity extends BaseActivity {
}
});
final Button tweetPojoButton = (Button) findViewById(
final Button tweetPojoButton = findViewById(
R.id.button_tweet_pojo_activity);
tweetPojoButton.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -103,7 +103,7 @@ public class TweetUiMainActivity extends BaseActivity {
}
});
final Button rtlTimelineButton = (Button) findViewById(R.id.button_rtl_timeline_activity);
final Button rtlTimelineButton = findViewById(R.id.button_rtl_timeline_activity);
rtlTimelineButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
......
......@@ -68,7 +68,7 @@ public class UniqueTweetActivity extends TweetUiActivity {
final View v = inflater.inflate(R.layout.tweetui_fragment_unique_tweet, container,
false);
final LinearLayout tweetRegion = (LinearLayout) v.findViewById(R.id.tweet_region);
final LinearLayout tweetRegion = v.findViewById(R.id.tweet_region);
// Tweet object already present, construct a TweetView
final Tweet knownTweet = new TweetBuilder()
......
......@@ -45,7 +45,7 @@ public class UserTimelineRecyclerViewFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.tweetui_timeline_recyclerview, container, false);
final RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
final RecyclerView recyclerView = view.findViewById(R.id.recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
......
......@@ -56,7 +56,7 @@ public class TwitterCoreMainActivity extends BaseActivity {
// Set up the login button by setting callback to invoke when authorization request
// completes
loginButton = (TwitterLoginButton) findViewById(R.id.login_button);
loginButton = findViewById(R.id.login_button);
loginButton.setCallback(new Callback<TwitterSession>() {
@Override
public void success(Result<TwitterSession> result) {
......
......@@ -52,7 +52,7 @@ public class ComposerActivity extends Activity {
setTheme(themeResId);
setContentView(R.layout.tw__activity_composer);
final ComposerView composerView = (ComposerView) findViewById(R.id.tw__composer_view);
final ComposerView composerView = findViewById(R.id.tw__composer_view);
composerController = new ComposerController(composerView, session, imageUri, text, hashtags,
new FinisherImpl());
}
......
......@@ -131,14 +131,14 @@ public class ComposerView extends LinearLayout {
}
void findSubviews() {
avatarView = (ImageView) findViewById(R.id.tw__author_avatar);
closeView = (ImageView) findViewById(R.id.tw__composer_close);
tweetEditView = (EditText) findViewById(R.id.tw__edit_tweet);
charCountView = (TextView) findViewById(R.id.tw__char_count);
tweetButton = (Button) findViewById(R.id.tw__post_tweet);
scrollView = (ObservableScrollView) findViewById(R.id.tw__composer_scroll_view);
avatarView = findViewById(R.id.tw__author_avatar);
closeView = findViewById(R.id.tw__composer_close);
tweetEditView = findViewById(R.id.tw__edit_tweet);
charCountView = findViewById(R.id.tw__char_count);
tweetButton = findViewById(R.id.tw__post_tweet);
scrollView = findViewById(R.id.tw__composer_scroll_view);
divider = findViewById(R.id.tw__composer_profile_divider);
imageView = (ImageView) findViewById(R.id.tw__image_view);
imageView = findViewById(R.id.tw__image_view);
}
void setCallbacks(ComposerController.ComposerCallbacks callbacks) {
......
......@@ -125,7 +125,7 @@ public class TweetUploadServiceTest {
when(mockStatusesService.update(anyString(), isNull(Long.class), isNull(Boolean.class),
isNull(Double.class), isNull(Double.class), isNull(String.class),
isNull(Boolean.class), eq(true), isNull(String.class)))
.thenReturn(Calls.<Tweet>failure(new IOException("")));
.thenReturn(Calls.failure(new IOException("")));
service.uploadTweet(mock(TwitterSession.class), EXPECTED_TWEET_TEXT, null);
......
......@@ -89,7 +89,7 @@ public abstract class BaseTweetViewXmlTest extends TweetUiTestCase {
final View view = LayoutInflater.from(getContext()).inflate(
R.layout.activity_tweet_actions_enabled, group, true);
final BaseTweetView tweetView = (BaseTweetView) view.findViewById(R.id.tweet_view);
final BaseTweetView tweetView = view.findViewById(R.id.tweet_view);
assertTrue(tweetView.tweetActionsEnabled);
}
......
......@@ -187,7 +187,7 @@ public class TweetTimelineListAdapterTest extends TweetUiTestCase {
final ArgumentCaptor<EventNamespace> tfwNamespaceCaptor
= ArgumentCaptor.forClass(EventNamespace.class);
final ArgumentCaptor<List<ScribeItem>> scribeItemsCaptor
= ArgumentCaptor.forClass((Class) List.class);
= ArgumentCaptor.forClass(List.class);
final TimelineDelegate<Tweet> mockTimelineDelegate = mock(TestTimelineDelegate.class);
new TweetTimelineListAdapter(getContext(), mockTimelineDelegate, ANY_STYLE,
......
......@@ -176,7 +176,7 @@ public class TweetTimelineRecyclerViewAdapterTest extends TweetUiTestCase {
final ArgumentCaptor<EventNamespace> tfwNamespaceCaptor
= ArgumentCaptor.forClass(EventNamespace.class);
final ArgumentCaptor<List<ScribeItem>> scribeItemsCaptor
= ArgumentCaptor.forClass((Class) List.class);
= ArgumentCaptor.forClass(List.class);
final TimelineDelegate<Tweet> mockTimelineDelegate = mock(TestTimelineDelegate.class);
new TweetTimelineRecyclerViewAdapter(getContext(), mockTimelineDelegate, ANY_STYLE,
......
......@@ -132,7 +132,7 @@ public final class TestFixtures {
public static final List<Tweet> ORDERED_MISSING_TWEETS = new ArrayList<>();
public static final BindingValues TEST_BINDING_VALUES =
new BindingValues(Collections.<String, Object>emptyMap());
new BindingValues(Collections.emptyMap());
public static final String PLAYER_CARD_VINE = VineCardUtils.VINE_CARD;
public static final String TEST_VINE_USER_ID = "586671909";
......
......@@ -147,13 +147,13 @@ abstract class AbstractTweetView extends RelativeLayout{
*/
void findSubviews() {
// Tweet attribution (avatar, name, screen name, etc.)
fullNameView = (TextView) findViewById(R.id.tw__tweet_author_full_name);
screenNameView = (TextView) findViewById(R.id.tw__tweet_author_screen_name);
fullNameView = findViewById(R.id.tw__tweet_author_full_name);
screenNameView = findViewById(R.id.tw__tweet_author_screen_name);
mediaContainer =
(AspectRatioFrameLayout) findViewById(R.id.tw__aspect_ratio_media_container);
tweetMediaView = (TweetMediaView) findViewById(R.id.tweet_media_view);
contentView = (TextView) findViewById(R.id.tw__tweet_text);
mediaBadgeView = (MediaBadgeView) findViewById(R.id.tw__tweet_media_badge);
findViewById(R.id.tw__aspect_ratio_media_container);
tweetMediaView = findViewById(R.id.tweet_media_view);
contentView = findViewById(R.id.tw__tweet_text);
mediaBadgeView = findViewById(R.id.tw__tweet_media_badge);
}
/*
......
......@@ -281,12 +281,12 @@ public abstract class BaseTweetView extends AbstractTweetView {
void findSubviews() {
super.findSubviews();
avatarView = (ImageView) findViewById(R.id.tw__tweet_author_avatar);
timestampView = (TextView) findViewById(R.id.tw__tweet_timestamp);
twitterLogoView = (ImageView) findViewById(R.id.tw__twitter_logo);
retweetedByView = (TextView) findViewById(R.id.tw__tweet_retweeted_by);
tweetActionBarView = (TweetActionBarView) findViewById(R.id.tw__tweet_action_bar);
quoteTweetHolder = (ViewGroup) findViewById(R.id.quote_tweet_holder);
avatarView = findViewById(R.id.tw__tweet_author_avatar);
timestampView = findViewById(R.id.tw__tweet_timestamp);
twitterLogoView = findViewById(R.id.tw__twitter_logo);
retweetedByView = findViewById(R.id.tw__tweet_retweeted_by);
tweetActionBarView = findViewById(R.id.tw__tweet_action_bar);
quoteTweetHolder = findViewById(R.id.quote_tweet_holder);
bottomSeparator = findViewById(R.id.bottom_separator);
}
......
......@@ -52,7 +52,7 @@ public class GalleryActivity extends Activity {
final GalleryAdapter adapter = new GalleryAdapter(this, getSwipeToDismissCallback());
adapter.addAll(galleryItem.mediaEntities);
final ViewPager viewPager = (ViewPager) findViewById(R.id.tw__view_pager);
final ViewPager viewPager = findViewById(R.id.tw__view_pager);
final int marginPixels =
getResources().getDimensionPixelSize(R.dimen.tw__gallery_page_margin);
viewPager.setPageMargin(marginPixels);
......
......@@ -43,10 +43,10 @@ class PlayerController {
PlayerController(View rootView, SwipeToDismissTouchListener.Callback callback) {
this.rootView = rootView;
this.videoView = (VideoView) rootView.findViewById(R.id.video_view);
this.videoControlView = (VideoControlView) rootView.findViewById(R.id.video_control_view);
this.videoProgressView = (ProgressBar) rootView.findViewById(R.id.video_progress_view);
this.callToActionView = (TextView) rootView.findViewById(R.id.call_to_action_view);
this.videoView = rootView.findViewById(R.id.video_view);
this.videoControlView = rootView.findViewById(R.id.video_control_view);
this.videoProgressView = rootView.findViewById(R.id.video_progress_view);
this.callToActionView = rootView.findViewById(R.id.call_to_action_view);
this.callback = callback;
}
......
......@@ -58,8 +58,8 @@ public class TweetActionBarView extends LinearLayout {
}
void findSubviews() {
likeButton = (ToggleImageButton) findViewById(R.id.tw__tweet_like_button);
shareButton = (ImageButton) findViewById(R.id.tw__tweet_share_button);
likeButton = findViewById(R.id.tw__tweet_like_button);
shareButton = findViewById(R.id.tw__tweet_share_button);
}
/*
......
......@@ -54,8 +54,8 @@ public class MediaBadgeView extends FrameLayout {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View view = inflater.inflate(R.layout.tw__media_badge, this, true);
videoDuration = (TextView) view.findViewById(R.id.tw__video_duration);
badge = (ImageView) view.findViewById(R.id.tw__gif_badge);
videoDuration = view.findViewById(R.id.tw__video_duration);
badge = view.findViewById(R.id.tw__gif_badge);
}
public void setMediaEntity(MediaEntity entity) {
......
......@@ -225,11 +225,7 @@ public class TweetMediaView extends ViewGroup implements View.OnClickListener {
clearImageViews();
initializeImageViews(mediaEntities);
if (TweetMediaUtils.isPhotoType(mediaEntities.get(0))) {
internalRoundedCornersEnabled = true;
} else {
internalRoundedCornersEnabled = false;
}
internalRoundedCornersEnabled = TweetMediaUtils.isPhotoType(mediaEntities.get(0));
requestLayout();
}
......
......@@ -87,10 +87,10 @@ public class VideoControlView extends FrameLayout {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.tw__video_control, this);
stateControl = (ImageButton) findViewById(R.id.tw__state_control);
currentTime = (TextView) findViewById(R.id.tw__current_time);
duration = (TextView) findViewById(R.id.tw__duration);
seekBar = (SeekBar) findViewById(R.id.tw__progress);
stateControl = findViewById(R.id.tw__state_control);
currentTime = findViewById(R.id.tw__current_time);
duration = findViewById(R.id.tw__duration);
seekBar = findViewById(R.id.tw__progress);
seekBar.setMax((int) PROGRESS_BAR_TICKS);
seekBar.setOnSeekBarChangeListener(createProgressChangeListener());
......
......@@ -136,7 +136,7 @@ public class LikeTweetActionTest {
// - success result Tweet is marked as favorited
callback.failure(alreadyFavoritedException);
final ArgumentCaptor<Result<Tweet>> resultCaptor
= ArgumentCaptor.forClass((Class) Result.class);
= ArgumentCaptor.forClass(Result.class);
verify(mockCallback).success(resultCaptor.capture());
assertEquals(tweet.getId(), resultCaptor.getValue().data.getId());
assertTrue(resultCaptor.getValue().data.favorited);
......@@ -158,7 +158,7 @@ public class LikeTweetActionTest {
// - success result Tweet is marked as unfavorited
callback.failure(alreadyUnfavoritedException);
final ArgumentCaptor<Result<Tweet>> resultCaptor
= ArgumentCaptor.forClass((Class) Result.class);
= ArgumentCaptor.forClass(Result.class);
verify(mockCallback).success(resultCaptor.capture());
assertEquals(tweet.getId(), resultCaptor.getValue().data.getId());
assertFalse(resultCaptor.getValue().data.favorited);
......
......@@ -447,7 +447,7 @@ public class TimelineDelegateTest {
delegate = new TimelineDelegate<>(mockTimeline);
final TimelineStateHolder mockHolder = mock(TimelineStateHolder.class);
final TimelineDelegate.DefaultCallback cb = delegate.new DefaultCallback(null, mockHolder);
cb.failure((TwitterException) null);
cb.failure(null);
verify(mockHolder).finishTimelineRequest();
}
......
......@@ -25,7 +25,6 @@ import android.webkit.WebView;
import android.widget.ProgressBar;
import com.twitter.sdk.android.core.R;
import com.twitter.sdk.android.core.TwitterAuthConfig;
import com.twitter.sdk.android.core.TwitterAuthException;
import com.twitter.sdk.android.core.TwitterCore;
import com.twitter.sdk.android.core.internal.TwitterApi;
......@@ -54,8 +53,8 @@ public class OAuthActivity extends Activity implements OAuthController.Listener
super.onCreate(savedInstanceState);
setContentView(R.layout.tw__activity_oauth);
spinner = (ProgressBar) findViewById(R.id.tw__spinner);
webView = (WebView) findViewById(R.id.tw__web_view);
spinner = findViewById(R.id.tw__spinner);
webView = findViewById(R.id.tw__web_view);
final boolean showProgress;
if (savedInstanceState != null) {
......@@ -67,7 +66,7 @@ public class OAuthActivity extends Activity implements OAuthController.Listener
final TwitterCore kit = TwitterCore.getInstance();
oAuthController = new OAuthController(spinner, webView,
(TwitterAuthConfig) getIntent().getParcelableExtra(EXTRA_AUTH_CONFIG),
getIntent().getParcelableExtra(EXTRA_AUTH_CONFIG),
new OAuth1aService(kit, new TwitterApi()), this);
oAuthController.startAuth();
}
......
......@@ -81,7 +81,7 @@ public class DefaultScribeClient extends ScribeClient {
public void scribe(EventNamespace... namespaces) {
for (EventNamespace ns : namespaces) {
scribe(ns, Collections.<ScribeItem>emptyList());
scribe(ns, Collections.emptyList());
}
}
......@@ -110,7 +110,7 @@ public class DefaultScribeClient extends ScribeClient {
* been installed on the device.
*/
scribe(ScribeEventFactory.newScribeEvent(namespace, eventInfo, timestamp, language,
advertisingId, Collections.<ScribeItem>emptyList()));
advertisingId, Collections.emptyList()));
}
// visible for tests
......
......@@ -61,7 +61,7 @@ public class ScribeEvent {
final List<ScribeItem> items;
public ScribeEvent(String category, EventNamespace eventNamespace, long timestamp) {
this(category, eventNamespace, timestamp, Collections.<ScribeItem>emptyList());
this(category, eventNamespace, timestamp, Collections.emptyList());
}
public ScribeEvent(String category, EventNamespace eventNamespace, long timestamp,
......
......@@ -25,7 +25,7 @@ public class ScribeEventFactory {
public static ScribeEvent newScribeEvent(EventNamespace ns, long timestamp, String language,
String advertisingId) {
return newScribeEvent(ns, "", timestamp, language, advertisingId,
Collections.<ScribeItem>emptyList());
Collections.emptyList());
}
public static ScribeEvent newScribeEvent(EventNamespace ns, String eventInfo, long timestamp,
......
......@@ -61,7 +61,7 @@ public class SyndicatedSdkImpressionEvent extends ScribeEvent {
public SyndicatedSdkImpressionEvent(EventNamespace eventNamespace, long timestamp,
String language, String adId) {
this(eventNamespace, timestamp, language, adId, Collections.<ScribeItem>emptyList());
this(eventNamespace, timestamp, language, adId, Collections.emptyList());
}
public SyndicatedSdkImpressionEvent(EventNamespace eventNamespace, long timestamp,
......
......@@ -21,7 +21,6 @@ import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import com.twitter.sdk.android.core.Callback;
import com.twitter.sdk.android.core.TwitterAuthConfig;
......@@ -140,7 +139,7 @@ public class SSOAuthHandlerTest {
final Activity mockActivity = mock(Activity.class);
TestUtils.setupTwitterInstalled(mockActivity, SSOAuthHandler.TWITTER_SIGNATURE);
when(mockActivity.getPackageManager().queryIntentActivities(any(Intent.class),
anyInt())).thenReturn(Collections.<ResolveInfo>emptyList());
anyInt())).thenReturn(Collections.emptyList());
assertFalse(ssoAuthHandler.authorize(mockActivity));
}
......