On Jun 22, Mark Wielaard wrote:
> On Thu, Jun 22, 2000 at 10:46:05AM -0400, Stuart Ballard wrote:
> > Jochen Hoenicke wrote:
> > > 
> > > Okay, I can do that, but is org.gnu.java.util.collections a good
> > > package name?  Or do you prefer something like
> > > gnu.classpath.collections?
> > 
> > Speaking for myself only, I'd suggest putting it in com.sun. I know that
> > it sucks to be writing code in Sun's package domain, but this would let
> > us be a drop-in replacement for Sun's code. Especially for binary-only
> > programs that assume it will be in com.sun...
> > 
> > Thoughts?
> 
> I would like them to be just in java.util where they are now.
> This shows that you can easily use (finished) parts of Classpath now.
> And it would indeed really suck to write packages for com.sun.
> 
> The reasons not to do this are:
> - Not all VMs/Classloaders allow adding to java.* packages
>   (And for security reasons that might be a very good thing.)

Especially Applets!  And since you should stick to 1.1 for applets for
best compatibility, that is a reason to use the collection package.

> - Some binary only programs expect them to be in com.sun.
>   (But do we really care about binary only programs?)

I don't think there are to many such applications.  Sun has hided
their collections package quite good :)

> So if you are really up for a challenge then you could try to
> generalize your perl script to turn it into a generic 
> package migration tool that dynamically changes classes
> so they appear in different packages but you have to
> be carefull to change all fully qualified package names and
> change the package and import staements.

That is probably difficult to do with .java source files.  I have an
obfuscator that can be used to migrate to different packages :-) (Only
.class files are changed)

> That way you could add a configure option for the actual package
> --collection-package=some.random.package

That is trivial to do.  One of the first lines of the perl script is 
my $destPkg="org.gnu.java.util.collections";

> I would love to write some of that.
> (I really would like to have a flexible package migration tool!)

http://jode.sourceforge.net/ contains my obfuscator, that can be used
for this purpose.  It is probably not as flexible as you want it
though; only renaming of complete packages is currently possible.  

> I have absolutely no time right now.
> But I would like to see the script that you use now.

http://www.informatik.uni-oldenburg.de/~delwi/classpath/buildcollections.pl

The renaming is almost trivial; the imports are hardcoded.  There is
also some change to make serialization 1.1 compatible.

  Jochen

Reply via email to