How to indentify which method was changed in a Java class?

Hi Community,

I would like to know which methods were changed in a Java class.

I get the Java class from the ChangeListManager.getAllChanges() method.
Now I want to know if there is a proper way to check whether the change was made in a method and if so which method it is.

I tried to parse the content of the different revision versions with a PsiElementFactory but if I call PsiClass.getAllMethods() it returns only the methods from an Object.


Comment actions Permalink

Creating a Java file from the old content using PsiFileFactory.createFileFromText() and comparing the list of methods in the old and new class is a good approach. If you're using the APIs correctly, it will return the complete list of methods.

Comment actions Permalink

Yes it works now.
I found out that I need to call getInnerClasses() on the dummy class to get the desired PsiClass.

Thank you


Please sign in to leave a comment.