You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2007/05/29 08:52:16 UTC

[jira] Resolved: (HARMONY-3869) [classlib][luni] Compatibility: File("", "") differs on Harmony and RI

     [ https://issues.apache.org/jira/browse/HARMONY-3869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paulex Yang resolved HARMONY-3869.
----------------------------------

    Resolution: Fixed

Ruth, patch applied at r542430, thanks a lot.

Elena, please verify if this issue is resolved as you expected. Thanks.

> [classlib][luni] Compatibility: File("", "") differs on Harmony and RI
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-3869
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3869
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Elena Sayapina
>            Assignee: Paulex Yang
>            Priority: Minor
>         Attachments: CFileTest.java, Harmony-3869.diff
>
>
> Constructors File(parent, String child) behave differently on Harmony and RI in case of empty pathname parent and empty pathname child.
> new File("", "").getPath() returns abstract path equals to File.separator while Harmony returns empty abstract path.
> NOTE that if child is not empty Harmony and RI act the same.
> Please, consider the following code:
> import java.io.File;
> public class CFileTest {
> 	
> 	public static void main(String[] args) {
> 		
> 		System.out.println("user.dir: " + System.getProperty("user.dir"));
> 		
> 		File file1 = new File("", "");
> 		System.out.println("Path 1: " + file1.getPath());
> 		System.out.println("Absolute path 1: " + file1.getAbsolutePath());
> 		
> 		File file2 = new File(new File(""), "");
> 		System.out.println("Path 2: " + file2.getPath());
> 		System.out.println("Absolute path 2: " + file2.getAbsolutePath());	
> 		
> 		File file3 = new File("", "file");
> 		System.out.println("Path 3: " + file3.getPath());
> 		System.out.println("Absolute path 3: " + file3.getAbsolutePath());
> 	}
> }
> Output on Harmony-r537771:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r537771, (May 14 2007), Windows/ia32/msvc 1310, release build
> http://incubator.apache.org/harmony
> user.dir: C:\users\evs
> Path 1:
> Absolute path 1: C:\users\evs
> Path 2:
> Absolute path 2: C:\users\evs
> Path 3: \file
> Absolute path 3: C:\file
> Output on HotSpot:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> user.dir: C:\users\evs
> Path 1: \
> Absolute path 1: C:\
> Path 2: \
> Absolute path 2: C:\
> Path 3: \file
> Absolute path 3: C:\file
> Please, use attached CFileTest.java for the test reproducing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.