dev@glassfish.java.net

Re: svn commit: r18296 - trunk/v3/core/kernel/src/main/java/com/sun/enterprise/v3/server/DomainXml.java

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Thu, 28 Feb 2008 09:25:43 -0800

On Feb 28, 2008, at 12:15 AM, Kedar Mhaswade wrote:

>
>
> Jerome Dochez wrote:
>> Byron
>> 2 things :
>> - can you explain why using getCanonicalFile() is desired here. I
>> am not sure I see an advantage...
>
> This is mostly related to Windows.
>
> On Windows, a file created with File f = new File("c:/temp/foo");
>
> has canonical path returned as "C:/temp/foo" whereas
> absolute path returned as "c:/temp/foo"
>
> (Observe the case), when the drive was created as "C:".
>
> I guess Canonical path returns the correct system specific path.
I see but you cannot have a C: letter drive and a c: letter drive on
windows, right ?

is this problem theorical, I mean what kind of issues can we get into
by not using it ?

>
>
>> - you do not respect the Java Coding style... please do so
>
> I am sorry, but at least this code is highly readable ...
>
ok let's clear this up once for all. All employees of Sun Microsystems
and GlassFish code committers have to follow the documented Java
Coding style, we certainly have better things to do than discuss which
code is more beautiful or more readable.

Jerome

>> thanks, Jerome
>> On Feb 27, 2008, at 1:24 AM, bnevins_at_dev.java.net wrote:
>>> + private File absolutize(File f)
>>> + {
>>> + try
>>> + {
>>> + return f.getCanonicalFile();
>>> + }
>>> + catch(Exception e)
>>> + {
>>> + return f.getAbsoluteFile();
>>> + }
>>> + }
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>