Tips and general rambling about Oracle JDeveloper, SCM, user interfaces, and other miscellaneous stuff.

Calendar

August 2003
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Jul   Sep

Brian Duff's Weblog

 13 August 2003


On Searching and Replacing

JDeveloper 9.0.5 is now officially called Oracle JDeveloper 10g. I had the distinctly unenjoyable task the other day of mass search-replacing "Oracle9i SCM" with "Oracle SCM" in both the 9.0.4 and 9.0.5 code bases...

I wish this were an easier job. I often need some way of finding all instances of a string recursively in a directory of files, checking all those files out of version control, replacing the found instances, then checking the files all back in again. I always seem to resort to one of these solutions:

  • hack together some perl. I'm notoriously bad for just doing this as a one-off then managing to lose the resulting useful bit of perl so that I have to rewrite it again the next time...
  • use jdeveloper's multi-file find. But then it's a hassle to actually check the files out, and do the replace. Note to self: log bug on this.
  • use windows explorer Find. Which worked quite nicely until Windows XP came along. The version control system we use for JDeveloper has handy Windows Explorer integration that makes it easy to check the files out from Windows Find. You can then easily open all the files up in a text editor, such as TextPad and do a mass search-replace. Windows XP, however, by default doesn't search inside .java files (even if you tell it to). Even if you hack the registry to make it do this, it still seems to arbitrarily miss out some files for no apparent reason.

This time round I opted for the "Use JDeveloper" option, because I'm going through a bout of perl-laziness. There must be a better way :) Next time I have a spare moment, maybe I'll hack together an extension for JDev that does this...


11:54:50 AM     comment []


weblog   |   articles
© Copyright 2003 Brian Duff. Last Updated 02/09/2003; 02:39:32.