mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[java-intentions] Create method from usage should skip external type annotation
Fixes (finally) IDEA-360115 Create method from List.of results in long jetbrains NotNull annotation (cherry picked from commit 8e1657ad1d3af686e50c048eea1f7c439ec7365b) IJ-CR-149633 GitOrigin-RevId: 1c86e8a1b9b0d5902f095ca7393bef8e2dea66d9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1097e6a771
commit
32684d7e9f
@@ -16,6 +16,7 @@ import com.intellij.psi.*
|
||||
import com.intellij.psi.PsiModifier.ModifierConstant
|
||||
import com.intellij.psi.impl.source.PsiClassImpl
|
||||
import com.intellij.psi.impl.source.jsp.jspJava.JspClass
|
||||
import com.intellij.psi.util.PsiTypesUtil
|
||||
|
||||
@ModifierConstant
|
||||
internal fun JvmModifier.toPsiModifier(): String = when (this) {
|
||||
@@ -66,7 +67,7 @@ internal fun extractExpectedTypes(project: Project, expectedTypes: ExpectedTypes
|
||||
private fun toExpectedTypeInfo(project: Project, expectedType: ExpectedType, context: PsiElement): ExpectedTypeInfo {
|
||||
if (expectedType is ExpectedJavaType) return expectedType.info
|
||||
val helper = JvmPsiConversionHelper.getInstance(project)
|
||||
var psiType = helper.convertType(expectedType.theType)
|
||||
var psiType = PsiTypesUtil.removeExternalAnnotations(helper.convertType(expectedType.theType))
|
||||
if (expectedType is ExpectedTypeWithNullability) {
|
||||
psiType =
|
||||
when (expectedType.nullability) {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// "Create method 'updatePublicWatchlist'" "true-preview"
|
||||
import java.util.List;
|
||||
|
||||
class X {
|
||||
// IDEA-360115
|
||||
void test() {
|
||||
updatePublicWatchlist("name", List.of("/CL:XNYM", "/NG:XNYM", "/6E:XCME", "/GC:XCEC", "/YM:XCBT"));
|
||||
}
|
||||
|
||||
private void updatePublicWatchlist(String name, List<String> strings) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Create method 'updatePublicWatchlist'" "true-preview"
|
||||
import java.util.List;
|
||||
|
||||
class X {
|
||||
// IDEA-360115
|
||||
void test() {
|
||||
<caret>updatePublicWatchlist("name", List.of("/CL:XNYM", "/NG:XNYM", "/6E:XCME", "/GC:XCEC", "/YM:XCBT"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user