wood burning stoves*
The moose likes Beginning Java and the fly likes OpenSource Code Cleaner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "OpenSource Code Cleaner" Watch "OpenSource Code Cleaner" New topic
Author

OpenSource Code Cleaner

Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
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

Is there any OpenSouce Tool for this?


My blood is tested +ve for Java.
pradeep jaladi
Ranch Hand

Joined: Nov 21, 2004
Posts: 65
Hi,

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.


Pradeep.Jaladi
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: OpenSource Code Cleaner