What if someone decided to explicitly reference the class every time they used it?

>>> billk / cts.com 12/06/01 12:28PM >>>

From: "Rich Kilmer" <rich / infoether.com>
>
> 3) Name your packages after your company domain and product (like
> sun told us to)

> 5) Change the name of the company (and domain) (major refactor)

> 6) The library is finally updated to use the standard convention of
> "com.domain.libraryname.classname" (major refactor)

Just curious, wouldn't a one-liner such as

  find . -name "*.java" -exec ruby -i -pe 'gsub(/(import\s+com)\.foo/,"\1.bar")' {} \;

to change all "import com.foo..." to "import com.bar..." pretty
much handle all of the package renaming?  (Or am I missing some
aspect of it?)

(OK whoops I forgot about the 'package' declarations, but we
should be able to change the gsub to 

  gsub(/((?:import|package)\s+com)\.foo/,"\1.bar")

and still keep our one-liner :-)


Regards,

Bill