diff --git a/java/java-analysis-api/src/com/intellij/codeInspection/problemHolderUtil.kt b/java/java-analysis-api/src/com/intellij/codeInspection/problemHolderUtil.kt index 76c696ef98d1..2e16ff0859aa 100644 --- a/java/java-analysis-api/src/com/intellij/codeInspection/problemHolderUtil.kt +++ b/java/java-analysis-api/src/com/intellij/codeInspection/problemHolderUtil.kt @@ -2,10 +2,7 @@ package com.intellij.codeInspection import com.intellij.codeInspection.util.InspectionMessage -import org.jetbrains.uast.UAnchorOwner -import org.jetbrains.uast.UCallExpression -import org.jetbrains.uast.UDeclaration -import org.jetbrains.uast.UReferenceExpression +import org.jetbrains.uast.* @JvmOverloads fun ProblemsHolder.registerUProblem( @@ -49,4 +46,15 @@ fun ProblemsHolder.registerUProblem( ) { val anchor = element.referenceNameElement?.sourcePsi ?: return registerProblem(anchor, descriptionTemplate, highlightType, *fixes) +} + +@JvmOverloads +fun ProblemsHolder.registerUProblem( + element: UExpression, + descriptionTemplate: @InspectionMessage String, + vararg fixes: LocalQuickFix, + highlightType: ProblemHighlightType = ProblemHighlightType.GENERIC_ERROR_OR_WARNING) { + val anchor = element.sourcePsi ?: return + if (anchor.textLength == 0) return + registerProblem(anchor, descriptionTemplate, highlightType, *fixes) } \ No newline at end of file diff --git a/jvm/jvm-analysis-impl/resources/inspectionDescriptions/SourceToSinkFlow.html b/jvm/jvm-analysis-impl/resources/inspectionDescriptions/SourceToSinkFlow.html index 63de49f98c4e..edbf9a9c2efe 100644 --- a/jvm/jvm-analysis-impl/resources/inspectionDescriptions/SourceToSinkFlow.html +++ b/jvm/jvm-analysis-impl/resources/inspectionDescriptions/SourceToSinkFlow.html @@ -1,8 +1,8 @@ Reports cases when non-safe string is passed to a method with parameter marked with @Untainted annotations, returned from annotated methods -or assigned to annotated fields, parameters or local variables. +or assigned to annotated fields, parameters or local variables. Kotlin `set` and `get` methods for fields are not supported as entry points.

- Safe object is: +Safe object is: