Skip to content

Commit edcd651

Browse files
committed
Fix return type checks in UpdateAnnotationReturnTypeCheckProcessor
1 parent 7ef54f7 commit edcd651

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/returntype/UpdateAnnotationReturnTypeCheckProcessor.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
package org.domaframework.doma.intellij.inspection.dao.processor.returntype
1717

1818
import com.intellij.psi.PsiClass
19-
import com.intellij.psi.PsiClassType
2019
import com.intellij.psi.PsiParameter
2120
import com.intellij.psi.PsiTypes
2221
import org.domaframework.doma.intellij.common.psi.PsiDaoMethod
@@ -112,10 +111,10 @@ class UpdateAnnotationReturnTypeCheckProcessor(
112111
): Boolean {
113112
if (returnTypeClass?.isEntity() != true) return false
114113

115-
if (DomaClassName.OPTIONAL.isTargetClassNameStartsWith(paramClass.type.canonicalText)) {
116-
val optionalType = paramClass.type as? PsiClassType
114+
if (DomaClassName.OPTIONAL.isTargetClassNameStartsWith(returnTypeClass.psiClassType.canonicalText)) {
115+
val optionalType = returnTypeClass.psiClassType
117116
val optionalParam =
118-
optionalType?.parameters?.firstOrNull()
117+
optionalType.parameters.firstOrNull()
119118
?: return false
120119
return optionalParam.canonicalText == paramClass.type.canonicalText
121120
}

0 commit comments

Comments
 (0)