Skip to content

Commit 9fe1a18

Browse files
authored
Update jmh support to be compatible with Scala 3 (#1351)
Rebase to rerun CI
1 parent b69907d commit 9fe1a18

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/scala/io/bazel/rules_scala/jmh_support/BenchmarkGenerator.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,17 @@ object BenchmarkGenerator {
189189
.stripSuffix(".class")
190190
.replace(separator, ".")
191191

192-
var index = -1
193-
do {
194-
s = s.substring(index + 1)
192+
var index = 0
193+
while (index != -1) {
194+
s = s.substring(index)
195195
try {
196196
return Some(Class.forName(s, false, cl))
197197
} catch {
198198
case _: ClassNotFoundException =>
199199
// ignore and try next one
200200
index = s.indexOf('.')
201201
}
202-
} while (index != -1)
202+
}
203203

204204
log(s"Failed to find class for path $path")
205205
None

0 commit comments

Comments
 (0)