mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
EA-31069 - assert: RefactoringUtil.getChainedConstructor
This commit is contained in:
@@ -901,7 +901,7 @@ public class RefactoringUtil {
|
|||||||
@Nullable
|
@Nullable
|
||||||
public static PsiMethod getChainedConstructor(PsiMethod constructor) {
|
public static PsiMethod getChainedConstructor(PsiMethod constructor) {
|
||||||
final PsiCodeBlock constructorBody = constructor.getBody();
|
final PsiCodeBlock constructorBody = constructor.getBody();
|
||||||
LOG.assertTrue(constructorBody != null);
|
if (constructorBody == null) return null;
|
||||||
final PsiStatement[] statements = constructorBody.getStatements();
|
final PsiStatement[] statements = constructorBody.getStatements();
|
||||||
if (statements.length == 1 && statements[0] instanceof PsiExpressionStatement) {
|
if (statements.length == 1 && statements[0] instanceof PsiExpressionStatement) {
|
||||||
final PsiExpression expression = ((PsiExpressionStatement)statements[0]).getExpression();
|
final PsiExpression expression = ((PsiExpressionStatement)statements[0]).getExpression();
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// "Add constructor parameter" "true"
|
||||||
|
public enum La {
|
||||||
|
;
|
||||||
|
private String s;
|
||||||
|
|
||||||
|
private La(String s) {
|
||||||
|
this.s = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
private La(int a, String s);
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// "Add constructor parameter" "true"
|
||||||
|
public enum La {
|
||||||
|
;
|
||||||
|
private String s<caret>;
|
||||||
|
|
||||||
|
private La() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private La(int a);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user