|
32 | 32 | import consulo.language.psi.PsiModificationTracker; |
33 | 33 | import consulo.language.psi.util.LanguageCachedValueUtil; |
34 | 34 | import consulo.util.collection.ArrayUtil; |
35 | | - |
36 | 35 | import jakarta.annotation.Nonnull; |
37 | 36 |
|
38 | 37 | /** |
39 | 38 | * @author VISTALL |
40 | 39 | * @since 30.11.13. |
41 | 40 | */ |
42 | | -public class CSharpGenericParameterImpl extends CSharpStubMemberImpl<CSharpGenericParameterStub> implements CSharpGenericParameter |
43 | | -{ |
44 | | - public CSharpGenericParameterImpl(@Nonnull ASTNode node) |
45 | | - { |
46 | | - super(node); |
47 | | - } |
| 41 | +public class CSharpGenericParameterImpl extends CSharpStubMemberImpl<CSharpGenericParameterStub> implements CSharpGenericParameter { |
| 42 | + public CSharpGenericParameterImpl(@Nonnull ASTNode node) { |
| 43 | + super(node); |
| 44 | + } |
48 | 45 |
|
49 | | - public CSharpGenericParameterImpl(@Nonnull CSharpGenericParameterStub stub) |
50 | | - { |
51 | | - super(stub, CSharpStubElements.GENERIC_PARAMETER); |
52 | | - } |
| 46 | + public CSharpGenericParameterImpl(@Nonnull CSharpGenericParameterStub stub) { |
| 47 | + super(stub, CSharpStubElements.GENERIC_PARAMETER); |
| 48 | + } |
53 | 49 |
|
54 | | - @Override |
55 | | - public void accept(@Nonnull CSharpElementVisitor visitor) |
56 | | - { |
57 | | - visitor.visitGenericParameter(this); |
58 | | - } |
| 50 | + @Override |
| 51 | + public void accept(@Nonnull CSharpElementVisitor visitor) { |
| 52 | + visitor.visitGenericParameter(this); |
| 53 | + } |
59 | 54 |
|
60 | | - @Override |
61 | | - public int getIndex() |
62 | | - { |
63 | | - PsiElement parentByStub = getParentByStub(); |
64 | | - if(parentByStub instanceof DotNetGenericParameterList) |
65 | | - { |
66 | | - return ArrayUtil.find(((DotNetGenericParameterList) parentByStub).getParameters(), this); |
67 | | - } |
68 | | - return -1; |
69 | | - } |
| 55 | + @Override |
| 56 | + public int getIndex() { |
| 57 | + PsiElement parentByStub = getParentByStub(); |
| 58 | + if (parentByStub instanceof DotNetGenericParameterList) { |
| 59 | + return ArrayUtil.find(((DotNetGenericParameterList) parentByStub).getParameters(), this); |
| 60 | + } |
| 61 | + return -1; |
| 62 | + } |
70 | 63 |
|
71 | | - @RequiredReadAction |
72 | | - @Nonnull |
73 | | - @Override |
74 | | - public DotNetAttribute[] getAttributes() |
75 | | - { |
76 | | - DotNetModifierList modifierList = getModifierList(); |
77 | | - if(modifierList != null) |
78 | | - { |
79 | | - return modifierList.getAttributes(); |
80 | | - } |
81 | | - return DotNetAttribute.EMPTY_ARRAY; |
82 | | - } |
| 64 | + @RequiredReadAction |
| 65 | + @Nonnull |
| 66 | + @Override |
| 67 | + public DotNetAttribute[] getAttributes() { |
| 68 | + DotNetModifierList modifierList = getModifierList(); |
| 69 | + if (modifierList != null) { |
| 70 | + return modifierList.getAttributes(); |
| 71 | + } |
| 72 | + return DotNetAttribute.EMPTY_ARRAY; |
| 73 | + } |
83 | 74 |
|
84 | | - @RequiredReadAction |
85 | | - @Nonnull |
86 | | - @Override |
87 | | - public DotNetTypeRef[] getExtendTypeRefs() |
88 | | - { |
89 | | - return LanguageCachedValueUtil.getCachedValue(this, () -> CachedValueProvider.Result.create(CSharpGenericConstraintUtil.getExtendTypes(CSharpGenericParameterImpl.this), PsiModificationTracker |
90 | | - .OUT_OF_CODE_BLOCK_MODIFICATION_COUNT)); |
91 | | - } |
| 75 | + @RequiredReadAction |
| 76 | + @Nonnull |
| 77 | + @Override |
| 78 | + public DotNetTypeRef[] getExtendTypeRefs() { |
| 79 | + return LanguageCachedValueUtil.getCachedValue(this, () -> CachedValueProvider.Result.create(CSharpGenericConstraintUtil.getExtendTypes(CSharpGenericParameterImpl.this), PsiModificationTracker |
| 80 | + .MODIFICATION_COUNT)); |
| 81 | + } |
92 | 82 | } |
0 commit comments