@@ -93,14 +93,12 @@ class SqlBindVariableValidInspector : LocalInspectionTool() {
9393 isOnTheFly : Boolean ,
9494 ): SqlVisitor = sqlVisitor(holder)
9595
96- fun sqlVisitor (holder : ProblemsHolder ): SqlVisitor {
96+ private fun sqlVisitor (holder : ProblemsHolder ): SqlVisitor {
9797 return object : SqlVisitor () {
9898 override fun visitElement (o : PsiElement ) {
99- var file = o.containingFile ? : return
99+ val file = o.containingFile ? : return
100100 if (isJavaOrKotlinFileType(file) && o is PsiLiteralExpression ) {
101- val injectionFile = initInjectionElement(file, o.project, o)
102- if (injectionFile == null ) return
103-
101+ val injectionFile = initInjectionElement(file, o.project, o) ? : return
104102 injectionFile.accept(this )
105103 super .visitElement(o)
106104 }
@@ -132,14 +130,14 @@ class SqlBindVariableValidInspector : LocalInspectionTool() {
132130
133131 override fun visitElStaticFieldAccessExpr (o : SqlElStaticFieldAccessExpr ) {
134132 super .visitElStaticFieldAccessExpr(o)
135- var targetElement = o
133+ val targetElement = o
136134 checkStaticFieldAndMethodAccess(targetElement, holder)
137135 }
138136
139137 override fun visitElFieldAccessExpr (o : SqlElFieldAccessExpr ) {
140138 super .visitElFieldAccessExpr(o)
141- var file = o.containingFile ? : return
142- var targetElement = o
139+ val file = o.containingFile ? : return
140+ val targetElement = o
143141
144142 // Get element inside block comment
145143 val blockElement =
@@ -162,8 +160,8 @@ class SqlBindVariableValidInspector : LocalInspectionTool() {
162160
163161 override fun visitElPrimaryExpr (o : SqlElPrimaryExpr ) {
164162 super .visitElPrimaryExpr(o)
165- var file = o.containingFile ? : return
166- var targetElement = o
163+ val file = o.containingFile ? : return
164+ val targetElement = o
167165 val project = o.project
168166
169167 // Exclude fixed Literal
0 commit comments