Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refactoring

Status
Not open for further replies.

LuckyKoen

Programmer
Feb 14, 2005
57
BE
I currently use Eclipse to make my java projects. Eclipse allows refactoring of class names, and it will even update references in other classes and xml files to this class. However, you can only refactor one class at a time as far as I know.

Are there any tools available that can refactor a whole directory or sereval directories of .java and .xml files at once ?
 
for file in `ls .`
do
cat $file | sed 's/oldname/newname/g' > tmp
mv tmp $file
done

:)

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
for file in `ls .`
do
cat $file | sed 's/oldname/newname/g' > tmp
mv tmp $file
done

:)

That will only rename the file names, right ?

Dian : yes, you can refactor a package. This will only change the name of the package, not the names of the files in that package.

 
Nope, that will rip through every file in your directory, replacing the strings as stated in the 'sed' arg.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Btw, why would you want to do such a massive refactoring?

Cheers,
Dian
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top