PsiField (@NotNull PsiElementFactory factory) { PsiField field = factory.createField(myFieldNameOuterClass, factory.createType(myOuterClass)); PsiModifierList modifierList = field.getModifierList(); LOG.assertTrue(modifierList != null); modifierList.setModifierProperty(PsiModifier.FINAL, true); return field; }