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(
4545
4646 // builds Throws exception section
4747 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 ) {
5149 val exceptionName = thrownException.javaClass.name
5250 val reason = findExceptionReason(currentMethod, thrownException)
53- " {@link $exceptionName } $reason "
54- }
5551
56- if (exceptionThrow != null ) {
57- customJavaDocComment.throwsException = exceptionThrow
52+ customJavaDocComment.throwsException = " {@link $exceptionName } $reason "
5853 }
5954
6055 // builds Iterates section
Original file line number Diff line number Diff line change @@ -57,12 +57,9 @@ open class SimpleCommentBuilder(
5757 root : SimpleSentenceBlock ,
5858 currentMethod : SootMethod
5959 ) {
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)
6663 root.exceptionThrow = " $exceptionName $reason "
6764 }
6865 }
You can’t perform that action at this time.
0 commit comments