I want to clean up my source code. I am looking for a tool that read all .java files of given folder and its subfolders, and perform following operations (i) If length of commented block is more then 10 lines, remove it (ii) If SOP exist in catch block, replace it with e.printStackTrace(); (iii) Remove all SOPs
So far as per my knowledge there is no such a tool. You need to write your own program which reads the file one by one. and search for /* & */. if the length betwen them is more then 10 lines simple remove them. You can check for the remaining conditions also.