mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
[devkit] ExtensionDomExtender: cleanup
GitOrigin-RevId: d1d1a8451f96a86f2cdfdd9d912b151b538f64e8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
18a5fe8175
commit
5215aaff6d
@@ -87,7 +87,7 @@ public class ExtensionDomExtender extends DomExtender<Extension> {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static With findWithElement(List<? extends With> elements, PsiField field) {
|
||||
static With findWithElement(List<? extends With> elements, PsiField field) {
|
||||
for (With element : elements) {
|
||||
if (Comparing.equal(field.getName(), element.getAttribute().getStringValue())) {
|
||||
return element;
|
||||
@@ -96,7 +96,7 @@ public class ExtensionDomExtender extends DomExtender<Extension> {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void registerField(final DomExtensionsRegistrar registrar, @NotNull final PsiField field, With withElement) {
|
||||
private static void registerField(final DomExtensionsRegistrar registrar, @NotNull final PsiField field, @Nullable With withElement) {
|
||||
final PsiMethod getter = PropertyUtilBase.findGetterForField(field);
|
||||
final PsiMethod setter = PropertyUtilBase.findSetterForField(field);
|
||||
if (!field.hasModifierProperty(PsiModifier.PUBLIC) && (getter == null || setter == null)) {
|
||||
@@ -188,15 +188,10 @@ public class ExtensionDomExtender extends DomExtender<Extension> {
|
||||
@Nullable
|
||||
static PsiAnnotation findAnnotation(final Class<?> annotationClass, PsiMember... members) {
|
||||
for (PsiMember member : members) {
|
||||
if (member != null) {
|
||||
final PsiModifierList modifierList = member.getModifierList();
|
||||
if (modifierList != null) {
|
||||
final PsiAnnotation annotation = modifierList.findAnnotation(annotationClass.getName());
|
||||
if (annotation != null) {
|
||||
return annotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (member == null) continue;
|
||||
|
||||
final PsiAnnotation annotation = member.getAnnotation(annotationClass.getName());
|
||||
if (annotation != null) return annotation;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user