mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
generate setter prototype from field: take context into account to gic resulted method correct parameter type (IDEA-104592)
This commit is contained in:
@@ -441,7 +441,7 @@ public class PropertyUtil {
|
||||
String propertyName = codeStyleManager.variableNameToPropertyName(name, kind);
|
||||
String setName = suggestSetterName(project, field);
|
||||
try {
|
||||
PsiMethod setMethod = factory.createMethod(setName, returnSelf ? factory.createType(containingClass) : PsiType.VOID);
|
||||
PsiMethod setMethod = factory.createMethodFromText(factory.createMethod(setName, returnSelf ? factory.createType(containingClass) : PsiType.VOID).getText(), field);
|
||||
String parameterName = codeStyleManager.propertyNameToVariableName(propertyName, VariableKind.PARAMETER);
|
||||
PsiParameter param = factory.createParameter(parameterName, field.getType());
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create getter and setter for 's'" "false"
|
||||
class A<T> {
|
||||
private T <caret>s;
|
||||
|
||||
T getS() {
|
||||
return s;
|
||||
}
|
||||
|
||||
void setS(T s) {
|
||||
this.s = s;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user