Eelco Hillenius wrote:

> Johan Compagner wrote:
> > and if i remember correctly, back then it looked if the FileUpload
project
> > was really in suspend stage.
> > there wasn't much happening on it, so i am talking abou the time we
added it
> > to the core of wicket

> Yeah, that's one of the reasons why we felt we would be able to get
> rid of the dependency without troubles.

I have no issue with you pulling pieces of Commons IO and Commons
FileUpload.  I object to the use of and dependence on finalizers.

As noted:

> Noel J. Bergman wrote:
> > "So you do have an old version of the FileCleaner, albeit prior to
> > enhancements that have been added to the current version in Commons, and
you
> > have added some support for it to
> > org/apache/wicket/util/upload/DiskFileItem.java, but you also have a
bogus
> > finalizer in DiskFileItem"

Having FileCleaner is a good thing.  You might want to update your copy, and
also look at how it is used in Commons FileUpload, but what caught my eye
was the comment about adding a finalize() method.

Not only should you not need to add a finalizer, but most importantly,
review your codebase and *remove* all finalizers.  Removing all finalize()
methods is Java 101, at least for long running processes, which is typical
of our server-side work.  It was a mistake to put into the language; as per
Sun: "the finalize() method should never have been provided in the first
place. PhantomReferences are definitely safer and more efficient to use."
In addition, the two "clean-up" mechanisms do not play nicely together,
although that's largely down to why finalizers are such a bad idea in the
first place.

        --- Noel


Reply via email to