I would like to know the name of a Java library which is able to detect changes in text in two text files (or Strings).
I want to detect the changes on saving a java source file and ultimately want to know the name of the method on which a changes was performed.
I would like to know the name of a Java library which is able
Share
If the details of the change aren’t important (just that the files have changed) then you can use a hash (such as MD5) to detect that the change.
Otherwise you should use one of the diff utilities like this and then pair that with a source info library like QDox. You could use the diff utility to determine where the changes are, and then use QDox to determine the method start/end lines that are around the changes.