style: 全项目统一 Tab 缩进并补全尾随逗号

This commit is contained in:
2026-11-07 13:54:46 +08:00
parent 7a3bc01b11
commit 5714aef444
195 changed files with 37684 additions and 37406 deletions
@@ -28,52 +28,52 @@ import java.util.concurrent.TimeUnit
*/
object SleepUtils {
/**
* 基于 Thread.sleep 的等待,单位毫秒
*
* @param millis 等待时间(毫秒)
* @throws RuntimeException 当线程被中断时抛出
*/
@JvmStatic
fun sleep(millis: Long) {
try {
Thread.sleep(millis)
} catch (e: InterruptedException) {
Thread.currentThread().interrupt()
throw RuntimeException("Sleep interrupted", e)
}
}
/**
* 基于 Thread.sleep 的等待,单位毫秒
*
* @param millis 等待时间(毫秒)
* @throws RuntimeException 当线程被中断时抛出
*/
@JvmStatic
fun sleep(millis: Long) {
try {
Thread.sleep(millis)
} catch (e: InterruptedException) {
Thread.currentThread().interrupt()
throw RuntimeException("Sleep interrupted", e)
}
}
/**
* 基于 Thread.sleep 的等待,单位毫秒
*
* @param millis 等待时间(毫秒)
* @throws RuntimeException 当线程被中断时抛出
*/
@JvmStatic
fun sleep(millis: Int) {
try {
Thread.sleep(millis.toLong())
} catch (e: InterruptedException) {
Thread.currentThread().interrupt()
throw RuntimeException("Sleep interrupted", e)
}
}
/**
* 基于 Thread.sleep 的等待,单位毫秒
*
* @param millis 等待时间(毫秒)
* @throws RuntimeException 当线程被中断时抛出
*/
@JvmStatic
fun sleep(millis: Int) {
try {
Thread.sleep(millis.toLong())
} catch (e: InterruptedException) {
Thread.currentThread().interrupt()
throw RuntimeException("Sleep interrupted", e)
}
}
/**
* 基于 TimeUnit 的等待
*
* @param timeout 等待时间
* @param unit 时间单位
* @throws RuntimeException 当线程被中断时抛出
*/
@JvmStatic
fun sleep(timeout: Long, unit: TimeUnit) {
try {
unit.sleep(timeout)
} catch (e: InterruptedException) {
Thread.currentThread().interrupt()
throw RuntimeException("Sleep interrupted", e)
}
}
/**
* 基于 TimeUnit 的等待
*
* @param timeout 等待时间
* @param unit 时间单位
* @throws RuntimeException 当线程被中断时抛出
*/
@JvmStatic
fun sleep(timeout: Long, unit: TimeUnit) {
try {
unit.sleep(timeout)
} catch (e: InterruptedException) {
Thread.currentThread().interrupt()
throw RuntimeException("Sleep interrupted", e)
}
}
}