From commits-return-56674-apmail-harmony-commits-archive=harmony.apache.org@harmony.apache.org Tue Dec 09 12:57:10 2008 Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 7501 invoked from network); 9 Dec 2008 12:57:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Dec 2008 12:57:10 -0000 Received: (qmail 87946 invoked by uid 500); 9 Dec 2008 12:57:23 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 87930 invoked by uid 500); 9 Dec 2008 12:57:23 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 87888 invoked by uid 99); 9 Dec 2008 12:57:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2008 04:57:22 -0800 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2008 12:57:07 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 544CE234C2B4 for ; Tue, 9 Dec 2008 04:56:44 -0800 (PST) Message-ID: <1942120357.1228827404343.JavaMail.jira@brutus> Date: Tue, 9 Dec 2008 04:56:44 -0800 (PST) From: "Tim Ellison (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-6034) [classlib] [luni] Should Improve File System Exception Messages In-Reply-To: <297100561.1228445444854.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-6034?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654788#action_12654788 ] Tim Ellison commented on HARMONY-6034: -------------------------------------- The patch [1] is not safe, because hyfile_error_message() does not isolate the error to the current thread. More on the dev list. [1] https://issues.apache.org/jira/secure/attachment/12395634/HARMONY-6034.diff > [classlib] [luni] Should Improve File System Exception Messages > --------------------------------------------------------------- > > Key: HARMONY-6034 > URL: https://issues.apache.org/jira/browse/HARMONY-6034 > Project: Harmony > Issue Type: Improvement > Components: Classlib > Affects Versions: 5.0M8 > Reporter: Kevin Zhou > Fix For: 5.0M9 > > Attachments: HARMONY-6034.diff > > > Given a test scenario [1] where "t:" is a mapped drive letter to which the current user only has R+E access but doesn't have W acess. > Conduct this on RI [2] and HARMONY [3]. Obviously, RI return a FileNotFoundException with a "Access is denied" message while HARMONY does not provide information as to why the file is not found. This also occurs when the corresponding file doesn't exist, RI will throw FNF with "system fails to find ...". > I think there is a difference in information returned that makes it a bit easier to understand why the FNF Exception is occurring. > Should we improve this? > [1] > public static void main(String[] args) { > try { > File f = new File("t:/temp.file"); > if (f.exists()) { > System.out.println("File " + f.getAbsolutePath() + " exists"); > } > FileOutputStream fos = new FileOutputStream(f); > fos.write("Hello, World!".getBytes()); > fos.close(); > } catch (FileNotFoundException fnfe) { > fnfe.printStackTrace(System.err); > } catch (Throwable t) { > t.printStackTrace(System.err); > } > } > [2] Output from a FileNotFoundException on RI: > java.io.FileNotFoundException: t:/temp.file (Access is denied) > at java.io.FileOutputStream.open(Native Method) > at java.io.FileOutputStream.(FileOutputStream.java:201) > at java.io.FileOutputStream.(FileOutputStream.java:153) > at test.Main.main(Main.java:23) > [3] Output from a FileNotFoundException on HARMONY: > java.io.FileNotFoundException: t:/temp.file > at java.io.FileOutputStream.(Unknown Source) > at java.io.FileOutputStream.(Unknown Source) > at test.Main.main(Main.java:23) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.