File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
utbot-summary/src/main/kotlin/org/utbot/summary/comment Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -45,16 +45,11 @@ class CustomJavaDocCommentBuilder(
45
45
46
46
// builds Throws exception section
47
47
val thrownException = traceTag.result.exceptionOrNull()
48
- val exceptionThrow: String? = if (thrownException == null ) {
49
- traceTag.result.exceptionOrNull()?.let { it::class .qualifiedName }
50
- } else {
48
+ if (thrownException != null ) {
51
49
val exceptionName = thrownException.javaClass.name
52
50
val reason = findExceptionReason(currentMethod, thrownException)
53
- " {@link $exceptionName } $reason "
54
- }
55
51
56
- if (exceptionThrow != null ) {
57
- customJavaDocComment.throwsException = exceptionThrow
52
+ customJavaDocComment.throwsException = " {@link $exceptionName } $reason "
58
53
}
59
54
60
55
// builds Iterates section
Original file line number Diff line number Diff line change @@ -57,12 +57,9 @@ open class SimpleCommentBuilder(
57
57
root : SimpleSentenceBlock ,
58
58
currentMethod : SootMethod
59
59
) {
60
- val thrownException = traceTag.result.exceptionOrNull()
61
- if (thrownException == null ) {
62
- root.exceptionThrow = traceTag.result.exceptionOrNull()?.let { it::class .qualifiedName }
63
- } else {
64
- val exceptionName = thrownException.javaClass.simpleName
65
- val reason = findExceptionReason(currentMethod, thrownException)
60
+ traceTag.result.exceptionOrNull()?.let {
61
+ val exceptionName = it.javaClass.simpleName
62
+ val reason = findExceptionReason(currentMethod, it)
66
63
root.exceptionThrow = " $exceptionName $reason "
67
64
}
68
65
}
You can’t perform that action at this time.
0 commit comments