File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
cucumber-scala/src/main/scala/io/cucumber/scala Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ See also the [CHANGELOG](https://github.com/cucumber/cucumber-jvm/blob/master/CH
13
13
14
14
### Changed
15
15
16
+ - [ Internal] Fix ` getLocation ` wherever it was wrongly defined. ([ #404 ] ( https://github.com/cucumber/cucumber-jvm-scala/issues/404 ) )
17
+
16
18
### Deprecated
17
19
18
20
### Removed
@@ -24,6 +26,7 @@ See also the [CHANGELOG](https://github.com/cucumber/cucumber-jvm/blob/master/CH
24
26
### Changed
25
27
26
28
- [ Internal] Implement ` HookDefinition.getHookType ` and unimplement ` Location.getLocation ` . No impact expected for users.
29
+ ([ #401 ] ( https://github.com/cucumber/cucumber-jvm-scala/issues/401 ) )
27
30
28
31
## [ 8.29.0] (2025-07-15)
29
32
Original file line number Diff line number Diff line change @@ -9,9 +9,15 @@ private[scala] object Utils {
9
9
val frames = Thread .currentThread().getStackTrace
10
10
val currentClass = self.getClass.getName
11
11
// Note: the -1 check is here for Scala < 2.13 and objects
12
- frames.reverse
13
- .find(f => f.getClassName == currentClass && f.getLineNumber != - 1 )
14
- .get
12
+ frames.findLast(f =>
13
+ f.getClassName == currentClass && f.getLineNumber != - 1
14
+ ) match {
15
+ case Some (stackFrame) => stackFrame
16
+ case None =>
17
+ throw new IllegalStateException (
18
+ s " Not able to find stack frame for $currentClass"
19
+ )
20
+ }
15
21
}
16
22
17
23
}
You can’t perform that action at this time.
0 commit comments