From f9802a17a0d03c53352cbd3436806f84b0ab97a1 Mon Sep 17 00:00:00 2001 From: amandelpie Date: Fri, 23 Sep 2022 20:21:11 +0300 Subject: [PATCH] Removed wrong formatting --- .../comment/CustomJavaDocCommentBuilder.kt | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt index 8ea18fed5c..72e3385b49 100644 --- a/utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt +++ b/utbot-summary/src/main/kotlin/org/utbot/summary/comment/CustomJavaDocCommentBuilder.kt @@ -3,6 +3,8 @@ package org.utbot.summary.comment import org.utbot.framework.plugin.api.DocCustomTagStatement import org.utbot.framework.plugin.api.DocStatement import org.utbot.framework.plugin.api.exceptionOrNull +import org.utbot.summary.SummarySentenceConstants +import org.utbot.summary.SummarySentenceConstants.CARRIAGE_RETURN import org.utbot.summary.ast.JimpleToASTMap import org.utbot.summary.tag.TraceTagWithoutExecution import soot.SootMethod @@ -34,8 +36,8 @@ class CustomJavaDocCommentBuilder( val classReference = getClassReference(currentMethod.declaringClass.javaStyleName) val comment = CustomJavaDocComment( - classUnderTest = classReference, - methodUnderTest = methodReference, + classUnderTest = classReference.replace(CARRIAGE_RETURN, ""), + methodUnderTest = methodReference.replace(CARRIAGE_RETURN, ""), ) val rootSentenceBlock = SimpleSentenceBlock(stringTemplates = stringTemplates) @@ -49,7 +51,7 @@ class CustomJavaDocCommentBuilder( val exceptionName = thrownException.javaClass.name val reason = findExceptionReason(currentMethod, thrownException) - comment.throwsException = "{@link $exceptionName} $reason" + comment.throwsException = "{@link $exceptionName} $reason".replace(CARRIAGE_RETURN, "") } generateSequence(rootSentenceBlock) { it.nextBlock }.forEach { @@ -58,7 +60,7 @@ class CustomJavaDocCommentBuilder( } it.invokeSentenceBlock?.let { - comment.invokes += it.first + comment.invokes += it.first.replace(CARRIAGE_RETURN, "") it.second.stmtTexts.forEach { statement -> processStatement(statement, comment) } @@ -70,7 +72,7 @@ class CustomJavaDocCommentBuilder( numberOccurrencesToText( sentenceBlocks.size ) - ) + ).replace(CARRIAGE_RETURN, "") } } @@ -82,13 +84,13 @@ class CustomJavaDocCommentBuilder( comment: CustomJavaDocComment ) { when (statement.stmtType) { - StmtType.Invoke -> comment.invokes += "{@code ${statement.description}}" - StmtType.Condition -> comment.executesCondition += "{@code ${statement.description}}" - StmtType.Return -> comment.returnsFrom = "{@code ${statement.description}}" - StmtType.CaughtException -> comment.caughtException = "{@code ${statement.description}}" - StmtType.SwitchCase -> comment.switchCase = "{@code case ${statement.description}}" - StmtType.CountedReturn -> comment.countedReturn = "{@code ${statement.description}}" - StmtType.RecursionAssignment -> comment.recursion = "of {@code ${statement.description}}" + StmtType.Invoke -> comment.invokes += "{@code ${statement.description.replace(CARRIAGE_RETURN, "")}}" + StmtType.Condition -> comment.executesCondition += "{@code ${statement.description.replace(CARRIAGE_RETURN, "")}}" + StmtType.Return -> comment.returnsFrom = "{@code ${statement.description.replace(CARRIAGE_RETURN, "")}}" + StmtType.CaughtException -> comment.caughtException = "{@code ${statement.description.replace(CARRIAGE_RETURN, "")}}" + StmtType.SwitchCase -> comment.switchCase = "{@code case ${statement.description.replace(CARRIAGE_RETURN, "")}}" + StmtType.CountedReturn -> comment.countedReturn = "{@code ${statement.description.replace(CARRIAGE_RETURN, "")}}" + StmtType.RecursionAssignment -> comment.recursion = "of {@code ${statement.description.replace(CARRIAGE_RETURN, "")}}" } } } \ No newline at end of file