mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +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 GitOrigin-RevId: 8e1657ad1d3af686e50c048eea1f7c439ec7365b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2f0b30cdc4
commit
6b829b44b5
@@ -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) {
|
||||
|
||||
+13
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
+9
@@ -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