Skip to content

Commit

Permalink
fix wrong require() snowflake ID, fix wrong require() regex pattern o…
Browse files Browse the repository at this point in the history
…n matchTo() ext function
  • Loading branch information
danurahadi committed Jan 11, 2023
1 parent 8703122 commit 432339c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
}
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit 432339c

Please sign in to comment.