We have a huge (old legacy java) code-base, where many files (around 5k) have System.out.println's. We are planning to remove them for cleanup/performance reasons. How can we write a script that will replace them without introducing any issues in the code? The script cannot blindly delete them as following case can be an issue:
if ()
some.code...
else
System.out.println(...);
DB.close();
I'm thinking of replacing them with ';'. That will take care of above case. Do you see any other issues? Any other suggestions?