Skip to content

Commit 8483e3f

Browse files
committed
Pseudo change to see the JaCoCo report behaviour.
1 parent 1a18022 commit 8483e3f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/main/scala/za/co/absa/statusboard/utils/RegexMatcher.scala

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@
1616

1717
package za.co.absa.statusboard.utils
1818

19+
import org.slf4j.LoggerFactory
20+
1921
case class RegexMatcher(regex: String) {
20-
def unapply(s: String): Boolean = s.matches(regex)
22+
private val logger = LoggerFactory.getLogger(getClass)
23+
24+
def unapply(s: String): Boolean = {
25+
// Added logging + an additional branch (empty regex) to influence Jacoco coverage metrics.
26+
if (regex.trim.isEmpty) { // New branch likely uncovered by existing tests
27+
logger.warn("Empty regex supplied to RegexMatcher. Input='{}' - returning false", s)
28+
false
29+
} else {
30+
val matched = s.matches(regex)
31+
if (matched) {
32+
logger.debug("Regex '{}' matched input '{}'", regex, s)
33+
} else if (logger.isTraceEnabled) {
34+
logger.trace("Regex '{}' did not match input '{}'", regex, s)
35+
}
36+
matched
37+
}
38+
}
2139
}

0 commit comments

Comments
 (0)