Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
handle missing caller due to throws annotation
  • Loading branch information
PhilippSalvisberg committed Dec 15, 2019
commit 266268e9a54e719b2b63cbd520bd0baa4a24be1b
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Expectation extends AbstractModel {
def getFailureText() {
return '''
«message.trim»
«caller.trim»
«caller?.trim»
'''.toString.trim
}

Expand All @@ -38,10 +38,12 @@ class Expectation extends AbstractModel {

def getCallerLine() {
var Integer line = null
val p = Pattern.compile("(?i)\"[^\\\"]+\",\\s+line\\s*([0-9]+)")
val m = p.matcher(caller)
if (m.find) {
line = Integer.valueOf(m.group(1))
if (caller !== null) {
val p = Pattern.compile("(?i)\"[^\\\"]+\",\\s+line\\s*([0-9]+)")
val m = p.matcher(caller)
if (m.find) {
line = Integer.valueOf(m.group(1))
}
}
return line
}
Expand Down