Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One more org.cqfn.diktat.ruleset.utils.KotlinParseException: Text is not valid #1141

Closed
petertrr opened this issue Dec 3, 2021 · 2 comments · Fixed by #1190
Closed

One more org.cqfn.diktat.ruleset.utils.KotlinParseException: Text is not valid #1141

petertrr opened this issue Dec 3, 2021 · 2 comments · Fixed by #1190
Assignees
Labels
bug Something isn't working
Milestone

Comments

@petertrr
Copy link
Member

petertrr commented Dec 3, 2021

org.cqfn.diktat.ruleset.utils.KotlinParseException: Text is not valid: [""${window.location}/execution/$id" + if (status != null) "?status=$status" else """]

when trying to format

    private fun getHrefToExecution(id: Long, status: TestResultStatus?) =
        "${window.location}/execution/$id" + if (status != null) "?status=$status" else ""

Full stacktrace:

[ERROR] 2021-12-03 18:42:55 Internal error has occurred in rule [string-concatenation]. Please make an issue on this bug at https://github.com/cqfn/diKTat/. 
                       As a workaround you can disable these inspections in yml config: <[STRING_CONCATENATION]>.
                       Root cause of the problem is in [D:\projects\save-cloud\save-frontend\src\main\kotlin\org\cqfn\save\frontend\components\views\HistoryView.kt] file.
org.cqfn.diktat.ruleset.utils.KotlinParseException: Text is not valid: [""${window.location}/execution/$id" + if (status != null) "?status=$status" else """]
	at org.cqfn.diktat.ruleset.utils.KotlinParser.createNode(KotlinParser.kt:75)
	at org.cqfn.diktat.ruleset.utils.KotlinParser.createNode$default(KotlinParser.kt:75)
	at org.cqfn.diktat.ruleset.rules.chapter3.StringConcatenationRule.fixBinaryExpressionWithConcatenation(StringConcatenationRule.kt:115)
	at org.cqfn.diktat.ruleset.rules.chapter3.StringConcatenationRule.access$fixBinaryExpressionWithConcatenation(StringConcatenationRule.kt:31)
	at org.cqfn.diktat.ruleset.rules.chapter3.StringConcatenationRule$detectStringConcatenation$1.invoke(StringConcatenationRule.kt:65)
	at org.cqfn.diktat.ruleset.rules.chapter3.StringConcatenationRule$detectStringConcatenation$1.invoke(StringConcatenationRule.kt:61)
	at org.cqfn.diktat.ruleset.constants.Warnings.warnAndFix(Warnings.kt:260)
	at org.cqfn.diktat.ruleset.constants.Warnings.warnAndFix$default(Warnings.kt:202)
	at org.cqfn.diktat.ruleset.rules.chapter3.StringConcatenationRule.detectStringConcatenation(StringConcatenationRule.kt:61)
	at org.cqfn.diktat.ruleset.rules.chapter3.StringConcatenationRule.logic(StringConcatenationRule.kt:44)
...
@petertrr petertrr added the bug Something isn't working label Dec 3, 2021
@orchestr7
Copy link
Member

@Cheshiriks should have fixed it in #1183

@orchestr7
Copy link
Member

@Cheshiriks please check

@orchestr7 orchestr7 reopened this Jan 26, 2022
@orchestr7 orchestr7 added this to the 1.0.3 milestone Jan 26, 2022
Cheshiriks added a commit that referenced this issue Jan 26, 2022
### What's done:
* fixed if expression in rule
closes #1076, #1141
Cheshiriks added a commit that referenced this issue Jan 26, 2022
### What's done:
* fixed if expression in rule
closes #1076, #1141
Cheshiriks added a commit that referenced this issue Jan 26, 2022
### What's done:
* fixed if expression in rule
closes #1076, #1141
Cheshiriks added a commit that referenced this issue Jan 26, 2022
### What's done:
* fixed if expression in rule
closes #1076, #1141
Cheshiriks added a commit that referenced this issue Jan 26, 2022
### What's done:
* fixed if expression in rule
closes #1076, #1141
Cheshiriks added a commit that referenced this issue Jan 27, 2022
### What's done:
* fixed if expression in rule
closes #1076, #1141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants