Skip to content

Commit ef67673

Browse files
authored
Removed wrong formatting (#1006)
1 parent b17cd9a commit ef67673

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt

+14-12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package org.utbot.summary.comment
33
import org.utbot.framework.plugin.api.DocCustomTagStatement
44
import org.utbot.framework.plugin.api.DocStatement
55
import org.utbot.framework.plugin.api.exceptionOrNull
6+
import org.utbot.summary.SummarySentenceConstants
7+
import org.utbot.summary.SummarySentenceConstants.CARRIAGE_RETURN
68
import org.utbot.summary.ast.JimpleToASTMap
79
import org.utbot.summary.tag.TraceTagWithoutExecution
810
import 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

Comments
 (0)