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
1313
1414### Changed
1515
16+ - [ Internal] Fix ` getLocation ` wherever it was wrongly defined. ([ #404 ] ( https://github.com/cucumber/cucumber-jvm-scala/issues/404 ) )
17+
1618### Deprecated
1719
1820### Removed
@@ -24,6 +26,7 @@ See also the [CHANGELOG](https://github.com/cucumber/cucumber-jvm/blob/master/CH
2426### Changed
2527
2628- [ Internal] Implement ` HookDefinition.getHookType ` and unimplement ` Location.getLocation ` . No impact expected for users.
29+ ([ #401 ] ( https://github.com/cucumber/cucumber-jvm-scala/issues/401 ) )
2730
2831## [ 8.29.0] (2025-07-15)
2932
Original file line number Diff line number Diff line change @@ -9,9 +9,15 @@ private[scala] object Utils {
99 val frames = Thread .currentThread().getStackTrace
1010 val currentClass = self.getClass.getName
1111 // 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+ }
1521 }
1622
1723}
You can’t perform that action at this time.
0 commit comments