mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
create from new: fix type parameters setup (IDEA-128679; IDEA-128682)
This commit is contained in:
+1
-1
@@ -475,7 +475,7 @@ public abstract class CreateFromUsageBaseFix extends BaseIntentionAction {
|
||||
} else {
|
||||
while (true) {
|
||||
final String paramName = idx > 0 ? "T" + idx : "T";
|
||||
if (!typeParamNames.contains(paramName)) {
|
||||
if (typeParamNames.add(paramName)) {
|
||||
targetClass.getTypeParameterList().add(factory.createTypeParameterFromText(paramName, null));
|
||||
break;
|
||||
}
|
||||
|
||||
+1
-2
@@ -67,9 +67,8 @@ public class CreateInnerClassFromNewFix extends CreateClassFromNewFix {
|
||||
}
|
||||
created = (PsiClass)targetClass.add(created);
|
||||
|
||||
setupClassFromNewExpression(created, newExpression);
|
||||
|
||||
setupGenericParameters(created, ref);
|
||||
setupClassFromNewExpression(created, newExpression);
|
||||
}
|
||||
|
||||
private static boolean isInThisOrSuperCall(PsiNewExpression newExpression) {
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create Inner Class 'AInner'" "true"
|
||||
class Test {
|
||||
{
|
||||
AInner aInner = new AInner<String>(42);
|
||||
}
|
||||
|
||||
private class AInner<T> {
|
||||
public AInner(int i) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create Inner Class 'AInner'" "true"
|
||||
class Test {
|
||||
{
|
||||
AInner aInner = new AInner<String, String>(42);
|
||||
}
|
||||
|
||||
private class AInner<T, T1> {
|
||||
public AInner(int i) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create Inner Class 'AInner'" "true"
|
||||
class Test {
|
||||
{
|
||||
AInner aInner = new AIn<caret>ner<String>(42);
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create Inner Class 'AInner'" "true"
|
||||
class Test {
|
||||
{
|
||||
AInner aInner = new AIn<caret>ner<String, String>(42);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user