com.ancientlightstudios.quarkus.kotlin.openapi.PatternCache.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-kotlin-openapi Show documentation
Show all versions of quarkus-kotlin-openapi Show documentation
A support library providing shared classes that the generated code will use.
The newest version!
package com.ancientlightstudios.quarkus.kotlin.openapi
import java.util.concurrent.ConcurrentHashMap
object PatternCache {
// TODO: this is a good candidate for a memory leak. Is there another option? Maybe replace with constants, but they allocate memory too.
private val cache = ConcurrentHashMap()
fun compilePattern(pattern: String): Regex = cache.getOrPut(pattern) { Regex(pattern) }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy