@@ -3,6 +3,8 @@ package org.utbot.summary.comment
33import org.utbot.framework.plugin.api.DocCustomTagStatement
44import org.utbot.framework.plugin.api.DocStatement
55import org.utbot.framework.plugin.api.exceptionOrNull
6+ import org.utbot.summary.SummarySentenceConstants
7+ import org.utbot.summary.SummarySentenceConstants.CARRIAGE_RETURN
68import org.utbot.summary.ast.JimpleToASTMap
79import org.utbot.summary.tag.TraceTagWithoutExecution
810import soot.SootMethod
@@ -34,8 +36,8 @@ class CustomJavaDocCommentBuilder(
3436 val classReference = getClassReference(currentMethod.declaringClass.javaStyleName)
3537
3638 val comment = CustomJavaDocComment (
37- classUnderTest = classReference,
38- methodUnderTest = methodReference,
39+ classUnderTest = classReference.replace( CARRIAGE_RETURN , " " ) ,
40+ methodUnderTest = methodReference.replace( CARRIAGE_RETURN , " " ) ,
3941 )
4042
4143 val rootSentenceBlock = SimpleSentenceBlock (stringTemplates = stringTemplates)
@@ -49,7 +51,7 @@ class CustomJavaDocCommentBuilder(
4951 val exceptionName = thrownException.javaClass.name
5052 val reason = findExceptionReason(currentMethod, thrownException)
5153
52- comment.throwsException = " {@link $exceptionName } $reason "
54+ comment.throwsException = " {@link $exceptionName } $reason " .replace( CARRIAGE_RETURN , " " )
5355 }
5456
5557 generateSequence(rootSentenceBlock) { it.nextBlock }.forEach {
@@ -58,7 +60,7 @@ class CustomJavaDocCommentBuilder(
5860 }
5961
6062 it.invokeSentenceBlock?.let {
61- comment.invokes + = it.first
63+ comment.invokes + = it.first.replace( CARRIAGE_RETURN , " " )
6264 it.second.stmtTexts.forEach { statement ->
6365 processStatement(statement, comment)
6466 }
@@ -70,7 +72,7 @@ class CustomJavaDocCommentBuilder(
7072 numberOccurrencesToText(
7173 sentenceBlocks.size
7274 )
73- )
75+ ).replace( CARRIAGE_RETURN , " " )
7476 }
7577 }
7678
@@ -82,13 +84,13 @@ class CustomJavaDocCommentBuilder(
8284 comment : CustomJavaDocComment
8385 ) {
8486 when (statement.stmtType) {
85- StmtType .Invoke -> comment.invokes + = " {@code ${statement.description} }"
86- StmtType .Condition -> comment.executesCondition + = " {@code ${statement.description} }"
87- StmtType .Return -> comment.returnsFrom = " {@code ${statement.description} }"
88- StmtType .CaughtException -> comment.caughtException = " {@code ${statement.description} }"
89- StmtType .SwitchCase -> comment.switchCase = " {@code case ${statement.description} }"
90- StmtType .CountedReturn -> comment.countedReturn = " {@code ${statement.description} }"
91- StmtType .RecursionAssignment -> comment.recursion = " of {@code ${statement.description} }"
87+ StmtType .Invoke -> comment.invokes + = " {@code ${statement.description.replace( CARRIAGE_RETURN , " " ) } }"
88+ StmtType .Condition -> comment.executesCondition + = " {@code ${statement.description.replace( CARRIAGE_RETURN , " " ) } }"
89+ StmtType .Return -> comment.returnsFrom = " {@code ${statement.description.replace( CARRIAGE_RETURN , " " ) } }"
90+ StmtType .CaughtException -> comment.caughtException = " {@code ${statement.description.replace( CARRIAGE_RETURN , " " ) } }"
91+ StmtType .SwitchCase -> comment.switchCase = " {@code case ${statement.description.replace( CARRIAGE_RETURN , " " ) } }"
92+ StmtType .CountedReturn -> comment.countedReturn = " {@code ${statement.description.replace( CARRIAGE_RETURN , " " ) } }"
93+ StmtType .RecursionAssignment -> comment.recursion = " of {@code ${statement.description.replace( CARRIAGE_RETURN , " " ) } }"
9294 }
9395 }
9496}
0 commit comments