Skip to content

Commit 66688f4

Browse files
committed
Analysis: Use suppress in favor of suppress warnings for kotlin classes
The Kotlin stdlib related '@Suppress' annotation is preferable to the Java lang related '@SuppressWarnings' annotation, if not for anything, even just for consistency purposes. As such, the '@SuppressWarnings' is being replaced with '@Suppress' on all Kotlin classes, wherever it is found.
1 parent d81c5ed commit 66688f4

31 files changed

Lines changed: 50 additions & 52 deletions

WordPress/src/main/java/org/wordpress/android/AppInitializer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ class AppInitializer @Inject constructor(
533533
}
534534
}
535535

536-
@SuppressWarnings("unused")
536+
@Suppress("unused")
537537
@Subscribe(threadMode = ThreadMode.MAIN)
538538
fun onAuthenticationChanged(event: OnAuthenticationChanged) {
539539
if (accountStore.hasAccessToken()) {

WordPress/src/main/java/org/wordpress/android/WordPress.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ abstract class WordPress : MultiDexApplication() {
5858
@JvmStatic
5959
fun getRestClientUtils() = AppInitializer.restClientUtils
6060

61-
@SuppressWarnings("FunctionNaming")
61+
@Suppress("FunctionNaming")
6262
@JvmStatic
6363
fun getRestClientUtilsV1_1() = AppInitializer.restClientUtilsV1_1
6464

65-
@SuppressWarnings("FunctionNaming")
65+
@Suppress("FunctionNaming")
6666
@JvmStatic
6767
fun getRestClientUtilsV1_2() = AppInitializer.restClientUtilsV1_2
6868

69-
@SuppressWarnings("FunctionNaming")
69+
@Suppress("FunctionNaming")
7070
@JvmStatic
7171
fun getRestClientUtilsV1_3() = AppInitializer.restClientUtilsV1_3
7272

WordPress/src/main/java/org/wordpress/android/ui/JetpackRemoteInstallViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ class JetpackRemoteInstallViewModel
147147
}
148148

149149
// Network Callbacks
150+
@Suppress("unused")
150151
@Subscribe(threadMode = ThreadMode.BACKGROUND)
151-
@SuppressWarnings("unused")
152152
fun onEventsUpdated(event: OnJetpackInstalled) {
153153
val site = siteModel ?: return
154154
if (event.isError) {

WordPress/src/main/java/org/wordpress/android/ui/engagement/GetLikesUseCase.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ import kotlin.coroutines.suspendCoroutine
4646
class GetLikesUseCase @Inject constructor(
4747
private val networkUtilsWrapper: NetworkUtilsWrapper,
4848
private val dispatcher: Dispatcher,
49-
@SuppressWarnings("Unused")
50-
val commentStore: CommentStore,
51-
@SuppressWarnings("Unused")
52-
val postStore: PostStore,
49+
@Suppress("Unused") val commentStore: CommentStore,
50+
@Suppress("Unused") val postStore: PostStore,
5351
val accountStore: AccountStore
5452
) {
5553
private var getLikesContinuations = mutableMapOf<String, Continuation<OnChanged<*>>>()
@@ -76,7 +74,7 @@ class GetLikesUseCase @Inject constructor(
7674
getLikes(COMMENT_LIKE, this, fingerPrint, paginationParams)
7775
}
7876

79-
@SuppressWarnings("ComplexMethod", "NestedBlockDepth", "LoopWithTooManyJumpStatements")
77+
@Suppress("ComplexMethod", "NestedBlockDepth", "LoopWithTooManyJumpStatements")
8078
private suspend fun getLikes(
8179
category: LikeCategory,
8280
flow: FlowCollector<GetLikesState>,

WordPress/src/main/java/org/wordpress/android/ui/jetpack/JetpackCapabilitiesUseCase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ class JetpackCapabilitiesUseCase @Inject constructor(
9696
)
9797
}
9898

99+
@Suppress("unused")
99100
@Subscribe(threadMode = ThreadMode.MAIN)
100-
@SuppressWarnings("unused")
101101
fun onJetpackCapabilitiesFetched(event: OnJetpackCapabilitiesFetched) {
102102
continuation[event.remoteSiteId]?.let {
103103
continuation.remove(event.remoteSiteId)

WordPress/src/main/java/org/wordpress/android/ui/main/MeFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ class MeFragment : Fragment(R.layout.me_fragment), OnScrollToTopListener {
586586
}
587587
}
588588

589-
@SuppressWarnings("unused")
589+
@Suppress("unused")
590590
@Subscribe(threadMode = ThreadMode.MAIN)
591591
fun onAccountChanged(event: OnAccountChanged?) {
592592
binding?.refreshAccountDetails()

WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListFragmentPage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ class NotificationsListFragmentPage : ViewPagerFragment(R.layout.notifications_l
443443
notesAdapter!!.addAll(event.notes, true)
444444
}
445445

446-
@SuppressWarnings("unused")
446+
@Suppress("unused")
447447
@Subscribe(threadMode = MAIN)
448448
fun onEventMainThread(error: NotificationsRefreshError?) {
449449
if (isAdded) {

WordPress/src/main/java/org/wordpress/android/ui/plans/PlansViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ class PlansViewModel @Inject constructor(
8989
_plans.value = _cachedPlans.value
9090
}
9191

92+
@Suppress("unused")
9293
@Subscribe(threadMode = ThreadMode.MAIN)
93-
@SuppressWarnings("unused")
9494
fun onPlanOffersFetched(event: OnPlanOffersFetched) {
9595
if (event.isError && event.planOffers?.isEmpty() == false) {
9696
_listStatus.value = PlansListStatus.ERROR_WITH_CACHE

WordPress/src/main/java/org/wordpress/android/ui/posts/PrepublishingCategoriesFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ class PrepublishingCategoriesFragment : Fragment(R.layout.prepublishing_categori
205205
}
206206
}
207207

208-
@SuppressWarnings("unused")
208+
@Suppress("unused")
209209
@Subscribe(threadMode = MAIN)
210210
fun onTermUploaded(event: OnTermUploaded) {
211211
viewModel.onTermUploadedComplete(event)
212212
}
213213

214-
@SuppressWarnings("unused")
214+
@Suppress("unused")
215215
@Subscribe(threadMode = MAIN)
216216
fun onTaxonomyChanged(event: OnTaxonomyChanged) {
217217
viewModel.onTaxonomyChanged(event)

WordPress/src/main/java/org/wordpress/android/ui/posts/editor/StorePostViewModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ class StorePostViewModel
187187
_onFinish.postValue(Event(state))
188188
}
189189

190-
@SuppressWarnings("unused")
190+
@Suppress("unused")
191191
@Subscribe
192192
fun onPostUploaded(event: OnPostUploaded) {
193193
hideSavingProgressDialog()
194194
}
195195

196-
@SuppressWarnings("unused")
196+
@Suppress("unused")
197197
@Subscribe
198198
fun onPostChanged(event: OnPostChanged) {
199199
hideSavingProgressDialog()

0 commit comments

Comments
 (0)