|
13 | 13 | * See the License for the specific language governing permissions and |
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | | - |
17 | | -/* |
18 | | - * Created by IntelliJ IDEA. |
19 | | - * User: max |
20 | | - * Date: Nov 28, 2001 |
21 | | - * Time: 4:17:17 PM |
22 | | - * To change template for new class use |
23 | | - * Code Style | Class Templates options (Tools | IDE Options). |
24 | | - */ |
25 | 16 | package com.intellij.java.analysis.impl.codeInspection.reference; |
26 | 17 |
|
27 | 18 | import com.intellij.java.analysis.codeInspection.reference.RefClass; |
28 | 19 | import com.intellij.java.analysis.codeInspection.reference.RefImplicitConstructor; |
29 | 20 | import com.intellij.java.analysis.codeInspection.reference.RefJavaUtil; |
30 | 21 | import com.intellij.java.language.psi.PsiModifierListOwner; |
31 | | -import consulo.application.Application; |
32 | | -import consulo.application.util.function.Computable; |
33 | | -import consulo.language.editor.inspection.localize.InspectionLocalize; |
| 22 | +import consulo.annotation.access.RequiredReadAction; |
| 23 | +import consulo.application.ReadAction; |
| 24 | +import consulo.java.analysis.impl.localize.JavaInspectionsLocalize; |
34 | 25 | import consulo.language.psi.PsiFile; |
35 | 26 | import jakarta.annotation.Nonnull; |
36 | 27 | import jakarta.annotation.Nullable; |
37 | 28 |
|
| 29 | +/** |
| 30 | + * @author max |
| 31 | + * @since 2001-11-28 |
| 32 | + */ |
38 | 33 | public class RefImplicitConstructorImpl extends RefMethodImpl implements RefImplicitConstructor { |
| 34 | + RefImplicitConstructorImpl(RefClass ownerClass) { |
| 35 | + super(JavaInspectionsLocalize.inspectionReferenceImplicitConstructorName(ownerClass.getName()), ownerClass); |
| 36 | + } |
39 | 37 |
|
40 | | - RefImplicitConstructorImpl(RefClass ownerClass) { |
41 | | - super(InspectionLocalize.inspectionReferenceImplicitConstructorName(ownerClass.getName()).get(), ownerClass); |
42 | | - } |
43 | | - |
44 | | - @Override |
45 | | - public void buildReferences() { |
46 | | - getRefManager().fireBuildReferences(this); |
47 | | - } |
| 38 | + @Override |
| 39 | + @RequiredReadAction |
| 40 | + public void buildReferences() { |
| 41 | + getRefManager().fireBuildReferences(this); |
| 42 | + } |
48 | 43 |
|
49 | | - @Override |
50 | | - public boolean isSuspicious() { |
51 | | - return ((RefClassImpl) getOwnerClass()).isSuspicious(); |
52 | | - } |
| 44 | + @Override |
| 45 | + public boolean isSuspicious() { |
| 46 | + return ((RefClassImpl) getOwnerClass()).isSuspicious(); |
| 47 | + } |
53 | 48 |
|
54 | | - @Override |
55 | | - @Nonnull |
56 | | - public String getName() { |
57 | | - return InspectionLocalize.inspectionReferenceImplicitConstructorName(getOwnerClass().getName()).get(); |
58 | | - } |
| 49 | + @Nonnull |
| 50 | + @Override |
| 51 | + public String getName() { |
| 52 | + return JavaInspectionsLocalize.inspectionReferenceImplicitConstructorName(getOwnerClass().getName()).get(); |
| 53 | + } |
59 | 54 |
|
60 | | - @Override |
61 | | - public String getExternalName() { |
62 | | - return getOwnerClass().getExternalName(); |
63 | | - } |
| 55 | + @Override |
| 56 | + public String getExternalName() { |
| 57 | + return getOwnerClass().getExternalName(); |
| 58 | + } |
64 | 59 |
|
65 | | - @Override |
66 | | - public boolean isValid() { |
67 | | - return Application.get().runReadAction((Computable<Boolean>)() -> getOwnerClass().isValid()); |
68 | | - } |
| 60 | + @Override |
| 61 | + public boolean isValid() { |
| 62 | + return ReadAction.compute(() -> getOwnerClass().isValid()); |
| 63 | + } |
69 | 64 |
|
70 | | - @Override |
71 | | - public String getAccessModifier() { |
72 | | - return getOwnerClass().getAccessModifier(); |
73 | | - } |
| 65 | + @Override |
| 66 | + public String getAccessModifier() { |
| 67 | + return getOwnerClass().getAccessModifier(); |
| 68 | + } |
74 | 69 |
|
75 | | - @Override |
76 | | - public void setAccessModifier(String am) { |
77 | | - RefJavaUtil.getInstance().setAccessModifier(getOwnerClass(), am); |
78 | | - } |
| 70 | + @Override |
| 71 | + public void setAccessModifier(String am) { |
| 72 | + RefJavaUtil.getInstance().setAccessModifier(getOwnerClass(), am); |
| 73 | + } |
79 | 74 |
|
80 | | - @Override |
81 | | - public PsiModifierListOwner getElement() { |
82 | | - return getOwnerClass().getElement(); |
83 | | - } |
| 75 | + @Override |
| 76 | + public PsiModifierListOwner getElement() { |
| 77 | + return getOwnerClass().getElement(); |
| 78 | + } |
84 | 79 |
|
85 | | - @Override |
86 | | - @Nullable |
87 | | - public PsiFile getContainingFile() { |
88 | | - return getOwnerClass().getContainingFile(); |
89 | | - } |
| 80 | + @Nullable |
| 81 | + @Override |
| 82 | + public PsiFile getContainingFile() { |
| 83 | + return getOwnerClass().getContainingFile(); |
| 84 | + } |
90 | 85 |
|
91 | | - @Override |
92 | | - public RefClass getOwnerClass() { |
93 | | - return myOwnerClass == null ? super.getOwnerClass() : myOwnerClass; |
94 | | - } |
| 86 | + @Override |
| 87 | + public RefClass getOwnerClass() { |
| 88 | + return myOwnerClass == null ? super.getOwnerClass() : myOwnerClass; |
| 89 | + } |
95 | 90 | } |
0 commit comments