Change the modifier of PsiMethod
Answered
How i can change the modifier of existing method?
PsiModifierList modifierLists = psiMethod.getModifierList();
modifierLists.setModifierProperty(PsiModifier.PRIVATE, true);
I can retrieve it but i can not set it back to the method (setter doesnt exist) .
Please sign in to leave a comment.
Theodosios,
First of all, you can use a util method to make it shorter:
Can you also explain, what do you mean by setter doesn't exist?
Thank you it worked.
I wanted to do something like this:
But it worked the way you told me.