FilePermission Canonical path optimization

deven you youdwei at
Fri Dec 5 06:55:08 UTC 2014

Hi Bernd,

I will update the patch for the underscores. As to security manager I think
in most cases, FilePermission is used with it together.

>From the spec:

Absolute path:    is complete in that no other information is required in
order to locate the file that it denotes

Canonical Path: is both absolute and unique.
The precise definition of canonical form is system-dependent. This method
first converts this pathname to absolute form if necessary, as if by
invoking the getAbsolutePath()
 method, and then maps it to its unique form in a system-dependent way.
This typically involves removing redundant names such as "."and ".." from
the pathname, resolving symbolic links (on UNIX platforms), and converting
drive letters to a standard case (on Microsoft Windows platforms).

>From above, we can only use canonical path rather than absolute path
because absolute path may not be unique.

Thanks a lot!

2014-12-01 16:43 GMT+08:00 Bernd <ecki at>:

> Hello,
> I thik the underscores in method and field do not match very the other
> names in that file (or the JCL).
> If I understand right, this is an optimization for the case a security
> manager is not present? For the other case, maybe having absolute but not
> canonical file names is an option? Or maybe have a special optimization for
> JAVA_HOME prefixed names? Or does it help in that case as well?
> Gruss
> Bernd
> Am 01.12.2014 09:18 schrieb "deven you" <youdwei at>:
> > Hi All,
> >  File.getCanonicalPath() is a very time-consuming method, we observed
> > significant performance degradation from some application's startup stage
> > with However, lazying load the calls to
> > getCanonicalPath() from java.ioFilePermission is straightforward and
> solve
> > this problem effectively. Openjdk bug[1]  tracks this bug and here is the
> > patch [2]. Could anyone take a look?
> >
> > [1]
> > [2]
> >

More information about the core-libs-dev mailing list