dev@glassfish.java.net

Re: [v3] Metro dependency on com.sun.mail.util

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Fri, 22 Aug 2008 11:55:29 -0700

Fabian Ritzmann wrote:
> On 22. Aug 2008, at 11:01, V B Kumar Jayanti wrote:
>> Fabian Ritzmann wrote:
>>
>>> I can try and chase down what piece(s) of Metro exactly is depending
>>> on com.sun.mail.util if that helps?
>>>
>> XWSS uses it :
>> ./com/sun/xml/wss/impl/c14n/TextPlainCanonicalizer.java:import
>> com.sun.mail.util.CRLFOutputStream;
>>
>> May be we can internalize this class within XWSS to avoid the dependency.
>
> I see that XWSS has several dependencies on javax.mail as well. While
> getting rid of a dependency on an internal class is a good thing, we
> would still depend on the mail bundle. I think from the Metro point of
> view, the benefits of removing the dependency on this one package are
> negligible.

Just to be clear, none of the classes in com.sun.mail.util were
*intended* for public use. The intent was that they were for use
by the JavaMail implementation only. While most of them are unlikely
to change incompatibly, some of them do. Depending on CRLFOutputStream
is probably relatively safe, but if you want to be really clean you
should clone the source code into your own package.

Note that this JavaMail FAQ entry
http://java.sun.com/products/javamail/FAQ.html#repres
provides the source code to CRLFOutputStream with the intent that people
who need it should copy it. (Yes, it needs an updated license.)