Dear stackoverflow community!
I have to refactor a huge amount of java classes and want to do it automatized. I want to use Java JDT and write an eclipse plugin for this purpose.
Following 'problems' should be solved:
Methods should not throw generic Exceptions in their definition. I was thinking about deleting the Exception throws block and let eclipse auto-generate the throws declaration for me. Is this possible? I haven't found any resources about that. I am already able to get all relevant methods as JDT models, but don't know how to delete the throws block and invoke the auto-correct feature of eclipse.
// So instead of public int foo() throws Exception { // do some SQL-stuff } // Should be public int foo() throws SQLException, NoResultException { // do some SQL-stuff }
Protected fields should be rewritten to private and protected accessors should be provided. I think this is self explainable, but how to edit all references outside the Project to acess the getter? (There are no setter, and if there are, i could edit them by hand).
Thank you in advance and sorry for my English.