diff --git a/extra/src/main/kotlin/id/yoframework/extra/extension/regex/Regex.kt b/extra/src/main/kotlin/id/yoframework/extra/extension/regex/Regex.kt index feb447b..6e675cc 100644 --- a/extra/src/main/kotlin/id/yoframework/extra/extension/regex/Regex.kt +++ b/extra/src/main/kotlin/id/yoframework/extra/extension/regex/Regex.kt @@ -64,7 +64,7 @@ fun String.matchWith(pattern: String): Boolean { * @return Matcher */ fun String.matchTo(pattern: String): Matcher { - require(pattern.isEmpty()) { "Regex pattern is empty" } + require(pattern.isNotEmpty()) { "Regex pattern is empty" } val p: Pattern = Pattern.compile(pattern) return p.matcher(this) } diff --git a/extra/src/main/kotlin/id/yoframework/extra/snowflake/SnowFlake.kt b/extra/src/main/kotlin/id/yoframework/extra/snowflake/SnowFlake.kt index c09e26e..31dace5 100644 --- a/extra/src/main/kotlin/id/yoframework/extra/snowflake/SnowFlake.kt +++ b/extra/src/main/kotlin/id/yoframework/extra/snowflake/SnowFlake.kt @@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger private class SnowFlake(private val machineId: Int) { init { - require(machineId >= MAX_MACHINE_ID || machineId < 0) { + require(machineId in 1 until MAX_MACHINE_ID) { "Machine Number must between 0 - ${MAX_MACHINE_ID - 1}" } } diff --git a/gradle.properties b/gradle.properties index 087de9d..5b34f43 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Set the project version -version=0.4.9 +version=0.4.10 # Set the JVM heap size org.gradle.jvmargs=-Xms1g -Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options=-Xmx1G @@ -8,10 +8,10 @@ org.gradle.jvmargs=-Xms1g -Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfM org.gradle.daemon=false # Enable the build cache -org.gradle.caching=true +org.gradle.caching=false # Enable parallelize build -org.gradle.parallel=true +org.gradle.parallel=false # Enable configure on demand -org.gradle.configureondemand=true +org.gradle.configureondemand=false