public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: awk@spinnakernet.com
To: gcc-gnats@gcc.gnu.org
Subject: libgcj/6209: output of java.io.File.getParent returns incorrect results
Date: Sat, 06 Apr 2002 15:46:00 -0000	[thread overview]
Message-ID: <200204062341.SAA17466@panic.spinnakernet.com> (raw)


>Number:         6209
>Category:       libgcj
>Synopsis:       java.io.File.getParent returns incorrect results
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 06 15:46:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        3.1 20020406 (prerelease)
>Organization:
Spinnaker Networks Inc.
>Environment:
System: Linux panic.spinnakernet.com 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --host=i686-pc-linux-gnu --prefix=/spin/awk/compilers/gcc-3.1-hol --enable-shared --enable-threads=posix --enable-languages=c,c++,java --enable-version-specific-runtime-libs : (reconfigured) 
>Description:
	java.io.File returns a "/" whereas it should return a "null"
	when the path name does not name a parent (i.e. the path
        name is the root directory). The following
	java class when run on a sun jdk and on gcj displays the error.

	Run on sun jdk
	% javac FileTest.java
	% java FileTest
	Canonical Name "/" Name "" Parent Name "null"

	Run on head-of-line gcj

	% gcj --main=FileTest -o FileTest FileTest.java
        % ./FileTest
        Canonical Name "/" Name "" Parent Name "/"

>How-To-Repeat:
/*
 *  Test java.io.File.getParent() on a root directory.
 */
import java.io.File;

public class FileTest {
    public static void main(String[] args) {
        try {
            File f = new File("/");
            System.out.println("Canonical Name \"" + f.getCanonicalPath()
                          + "\" Name \"" +  f.getName() + "\" Parent Name \""
                           + f.getParent() + "\"");
        } catch(Exception e) {
            System.out.println(" Exception Thrown ");
        }
    }
};

>Fix:
	Fix libgcj java.io.File.java to match jdk api.
>Release-Note:
>Audit-Trail:
>Unformatted:


                 reply	other threads:[~2002-04-06 23:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200204062341.SAA17466@panic.spinnakernet.com \
    --to=awk@spinnakernet.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).