mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Generalize catch fix made aware of try-with-resources
This commit is contained in:
@@ -884,6 +884,14 @@ public final class PsiUtil extends PsiUtilBase {
|
||||
};
|
||||
|
||||
public static void setModifierProperty(@NotNull PsiModifierListOwner owner, @NotNull @Modifier String property, boolean value) {
|
||||
owner.getModifierList().setModifierProperty(property, value);
|
||||
final PsiModifierList modifierList = owner.getModifierList();
|
||||
assert modifierList != null : owner;
|
||||
modifierList.setModifierProperty(property, value);
|
||||
}
|
||||
|
||||
public static boolean isTryBlock(final PsiElement element) {
|
||||
return element instanceof PsiCodeBlock &&
|
||||
element.getParent() instanceof PsiTryStatement &&
|
||||
((PsiTryStatement)element.getParent()).getTryBlock() == element;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user