@@ -3,6 +3,8 @@ package org.utbot.summary.comment
3
3
import org.utbot.framework.plugin.api.DocCustomTagStatement
4
4
import org.utbot.framework.plugin.api.DocStatement
5
5
import org.utbot.framework.plugin.api.exceptionOrNull
6
+ import org.utbot.summary.SummarySentenceConstants
7
+ import org.utbot.summary.SummarySentenceConstants.CARRIAGE_RETURN
6
8
import org.utbot.summary.ast.JimpleToASTMap
7
9
import org.utbot.summary.tag.TraceTagWithoutExecution
8
10
import soot.SootMethod
@@ -34,8 +36,8 @@ class CustomJavaDocCommentBuilder(
34
36
val classReference = getClassReference(currentMethod.declaringClass.javaStyleName)
35
37
36
38
val comment = CustomJavaDocComment (
37
- classUnderTest = classReference,
38
- methodUnderTest = methodReference,
39
+ classUnderTest = classReference.replace( CARRIAGE_RETURN , " " ) ,
40
+ methodUnderTest = methodReference.replace( CARRIAGE_RETURN , " " ) ,
39
41
)
40
42
41
43
val rootSentenceBlock = SimpleSentenceBlock (stringTemplates = stringTemplates)
@@ -49,7 +51,7 @@ class CustomJavaDocCommentBuilder(
49
51
val exceptionName = thrownException.javaClass.name
50
52
val reason = findExceptionReason(currentMethod, thrownException)
51
53
52
- comment.throwsException = " {@link $exceptionName } $reason "
54
+ comment.throwsException = " {@link $exceptionName } $reason " .replace( CARRIAGE_RETURN , " " )
53
55
}
54
56
55
57
generateSequence(rootSentenceBlock) { it.nextBlock }.forEach {
@@ -58,7 +60,7 @@ class CustomJavaDocCommentBuilder(
58
60
}
59
61
60
62
it.invokeSentenceBlock?.let {
61
- comment.invokes + = it.first
63
+ comment.invokes + = it.first.replace( CARRIAGE_RETURN , " " )
62
64
it.second.stmtTexts.forEach { statement ->
63
65
processStatement(statement, comment)
64
66
}
@@ -70,7 +72,7 @@ class CustomJavaDocCommentBuilder(
70
72
numberOccurrencesToText(
71
73
sentenceBlocks.size
72
74
)
73
- )
75
+ ).replace( CARRIAGE_RETURN , " " )
74
76
}
75
77
}
76
78
@@ -82,13 +84,13 @@ class CustomJavaDocCommentBuilder(
82
84
comment : CustomJavaDocComment
83
85
) {
84
86
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 , " " ) } }"
92
94
}
93
95
}
94
96
}
0 commit comments