Skip to content

Commit 1792aeb

Browse files
committed
Modify optimize code style for @deprecated annotation
1 parent 359886d commit 1792aeb

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/YukiMemberHookCreator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class YukiMemberHookCreator @PublishedApi internal constructor(
301301
* @param name 方法名称
302302
* @return [ArrayList]<[MethodFinder.Result.Instance]>
303303
*/
304-
@Deprecated(message = "请使用新方式来实现 Hook 所有方法", ReplaceWith(expression = "method { this.name = name }.all()"))
304+
@Deprecated(message = "请使用新方式来实现 Hook 所有方法", ReplaceWith("method { this.name = name }.all()"))
305305
fun allMethods(name: String) = method { this.name = name }.all()
306306

307307
/**
@@ -314,7 +314,7 @@ class YukiMemberHookCreator @PublishedApi internal constructor(
314314
*/
315315
@Deprecated(
316316
message = "请使用新方式来实现 Hook 所有构造方法",
317-
ReplaceWith(expression = "allMembers(MembersType.CONSTRUCTOR)", "com.highcapable.yukihookapi.hook.factory.MembersType")
317+
ReplaceWith("allMembers(MembersType.CONSTRUCTOR)", "com.highcapable.yukihookapi.hook.factory.MembersType")
318318
)
319319
fun allConstructors() = allMembers(MembersType.CONSTRUCTOR)
320320

yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/ConstructorFinder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ class ConstructorFinder @PublishedApi internal constructor(
572572
* - ❗请现在转移到 [ignored]
573573
* @return [Result] 可继续向下监听
574574
*/
575-
@Deprecated(message = "请使用新的命名方法", ReplaceWith(expression = "ignored()"))
575+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("ignored()"))
576576
fun ignoredError() = ignored()
577577

578578
/**

yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/FieldFinder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ class FieldFinder @PublishedApi internal constructor(
458458
* - ❗请现在转移到 [ignored]
459459
* @return [Result] 可继续向下监听
460460
*/
461-
@Deprecated(message = "请使用新的命名方法", ReplaceWith(expression = "ignored()"))
461+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("ignored()"))
462462
fun ignoredError() = ignored()
463463

464464
/**

yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/core/finder/members/MethodFinder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ class MethodFinder @PublishedApi internal constructor(
668668
* - ❗请现在转移到 [ignored]
669669
* @return [Result] 可继续向下监听
670670
*/
671-
@Deprecated(message = "请使用新的命名方法", ReplaceWith(expression = "ignored()"))
671+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("ignored()"))
672672
fun ignoredError() = ignored()
673673

674674
/**

yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/factory/ReflectionFactory.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ fun Class<*>.toJavaPrimitiveType() = when (this) {
201201
* @return [Class]
202202
* @throws NoClassDefFoundError 如果找不到 [Class] 或设置了错误的 [ClassLoader]
203203
*/
204-
@Deprecated(message = "请使用新的命名方法", ReplaceWith(expression = "name.toClass(loader)"))
204+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("name.toClass(loader)"))
205205
fun classOf(name: String, loader: ClassLoader? = null) = name.toClass(loader)
206206

207207
/**
@@ -369,7 +369,7 @@ inline fun <reified T : Any> T.current(ignored: Boolean = false, initiate: Curre
369369
* - ❗请现在转移到 [buildOf]
370370
* @return [Any] or null
371371
*/
372-
@Deprecated(message = "请使用新的命名方法", replaceWith = ReplaceWith(expression = "buildOf(*param, initiate)"))
372+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("buildOf(*param, initiate)"))
373373
fun Class<*>.buildOfAny(vararg param: Any?, initiate: ConstructorConditions = { emptyParam() }) = buildOf(*param, initiate)
374374

375375
/**

yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/PackageParam.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ open class PackageParam internal constructor(@PublishedApi internal var wrapper:
457457
* @return [Class]
458458
* @throws NoClassDefFoundError 如果找不到 [Class]
459459
*/
460-
@Deprecated(message = "请使用新的命名方法", ReplaceWith(expression = "toClass()"))
460+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("toClass()"))
461461
val String.clazz
462462
get() = toClass()
463463

@@ -470,7 +470,7 @@ open class PackageParam internal constructor(@PublishedApi internal var wrapper:
470470
* @return [Class]
471471
* @throws IllegalStateException 如果任何 [Class] 都没有匹配到
472472
*/
473-
@Deprecated(message = "请使用新的命名方法", ReplaceWith(expression = "toClass()"))
473+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("toClass()"))
474474
val VariousClass.clazz
475475
get() = toClass()
476476

@@ -482,7 +482,7 @@ open class PackageParam internal constructor(@PublishedApi internal var wrapper:
482482
* - ❗请现在转移到 [hasClass]
483483
* @return [Boolean] 是否存在
484484
*/
485-
@Deprecated(message = "请使用新的命名方法", ReplaceWith(expression = "hasClass()"))
485+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("hasClass()"))
486486
val String.hasClass
487487
get() = hasClass()
488488

yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/type/java/VariableTypeFactory.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fun ArrayClass(type: Class<*>) = JavaArray.newInstance(type, 0).javaClass as Cla
7676
* - ❗请现在转移到 [AnyClass]
7777
* @return [Class]<[Any]>
7878
*/
79-
@Deprecated(message = "请使用新的命名方法", replaceWith = ReplaceWith(expression = "AnyClass"))
79+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("AnyClass"))
8080
val AnyType get() = AnyClass
8181

8282
/**
@@ -247,7 +247,7 @@ val UnitClass get() = classOf<Void>()
247247
* - ❗请现在转移到 [StringClass]
248248
* @return [Class]<[String]>
249249
*/
250-
@Deprecated(message = "请使用新的命名方法", replaceWith = ReplaceWith(expression = "StringClass"))
250+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("StringClass"))
251251
val StringType get() = StringClass
252252

253253
/**
@@ -258,7 +258,7 @@ val StringType get() = StringClass
258258
* - ❗请现在转移到 [CharSequenceClass]
259259
* @return [Class]<[CharSequence]>
260260
*/
261-
@Deprecated(message = "请使用新的命名方法", replaceWith = ReplaceWith(expression = "CharSequenceClass"))
261+
@Deprecated(message = "请使用新的命名方法", ReplaceWith("CharSequenceClass"))
262262
val CharSequenceType get() = CharSequenceClass
263263

264264
/**

yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class YukiHookModulePrefs private constructor(private var context: Context? = nu
193193
* - ❗请现在转移到 [isPreferencesAvailable]
194194
* @return [Boolean]
195195
*/
196-
@Deprecated(message = "请使用新方式来实现此功能", replaceWith = ReplaceWith(expression = "isPreferencesAvailable"))
196+
@Deprecated(message = "请使用新方式来实现此功能", ReplaceWith("isPreferencesAvailable"))
197197
val isXSharePrefsReadable get() = isPreferencesAvailable
198198

199199
/**
@@ -204,7 +204,7 @@ class YukiHookModulePrefs private constructor(private var context: Context? = nu
204204
* - ❗请现在转移到 [isPreferencesAvailable]
205205
* @return [Boolean]
206206
*/
207-
@Deprecated(message = "请使用新方式来实现此功能", replaceWith = ReplaceWith(expression = "isPreferencesAvailable"))
207+
@Deprecated(message = "请使用新方式来实现此功能", ReplaceWith("isPreferencesAvailable"))
208208
val isRunInNewXShareMode get() = isPreferencesAvailable
209209

210210
/**

yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/xposed/proxy/YukiHookXposedInitProxy.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import com.highcapable.yukihookapi.hook.log.yLoggerW
3939
*
4040
* - ❗请现在转移到 [IYukiHookXposedInit] 否则此接口的声明将在自动处理程序中被拦截
4141
*/
42-
@Deprecated(message = "此接口的命名和功能已被弃用", ReplaceWith(expression = "IYukiHookXposedInit"), level = DeprecationLevel.ERROR)
42+
@Deprecated(message = "此接口的命名和功能已被弃用", ReplaceWith("IYukiHookXposedInit"), level = DeprecationLevel.ERROR)
4343
interface YukiHookXposedInitProxy {
4444

4545
/**

0 commit comments

Comments
 (0)