Skip to content

Commit

Permalink
Fix quality flaw: Use "require", immutable list, remove unused import (
Browse files Browse the repository at this point in the history
  • Loading branch information
leveretka committed Dec 13, 2023
1 parent 5be4aaf commit 9eadc7a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private fun checkIfExpressionHasParameter(
first: KtExpression?,
second: KtExpression?,
klassParameters: List<KtParameter>,
methodParameters: MutableList<KtParameter>,
methodParameters: List<KtParameter>,
map: MutableMap<KtParameter, Boolean>,
) {
val parameter = findParameter(first, klassParameters) ?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import org.sonarsource.kotlin.externalreport.detekt.DetektRulesDefinition
import org.sonarsource.kotlin.externalreport.detekt.DetektSensor
import org.sonarsource.kotlin.externalreport.ktlint.KtlintRulesDefinition
import org.sonarsource.kotlin.externalreport.ktlint.KtlintSensor
import org.sonarsource.kotlin.gradle.GRADLE_PROJECT_ROOT_PROPERTY
import org.sonarsource.kotlin.gradle.KotlinGradleSensor
import org.sonarsource.kotlin.surefire.KotlinResourcesLocator
import org.sonarsource.kotlin.surefire.KotlinSurefireParser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
@javax.annotation.ParametersAreNonnullByDefault
package org.sonarsource.kotlin.api.frontend;
package org.sonarsource.kotlin.plugin.linking;
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class DummyInputFile(val path: Path? = null) : InputFile {
newRange(newPointer(startLine, startLineOffset), newPointer(endLine, endLineOffset))

override fun selectLine(line: Int): TextRange {
if (line > lines.size) throw IllegalArgumentException("Line not in file")
require(line <= lines.size) { "Line not in file" }
return newRange(line, 0, line, lines[line - 1].length)
}

Expand Down

0 comments on commit 9eadc7a

Please sign in to comment.