harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r773966 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java
Date Tue, 12 May 2009 16:23:08 GMT
Author: odeakin
Date: Tue May 12 16:23:08 2009
New Revision: 773966

URL: http://svn.apache.org/viewvc?rev=773966&view=rev
Log:
When constructing the exception, make sure the error message is in an encoding where it will
be readable on non-ASCII platforms once printed.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java?rev=773966&r1=773965&r2=773966&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java
Tue May 12 16:23:08 2009
@@ -20,6 +20,7 @@
 import java.io.FileDescriptor;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
 
 /**
  * This is the portable implementation of the file system interface.
@@ -235,7 +236,11 @@
 		}
 		long handler = openImpl(fileName, mode);
 		if (handler < 0) {
-			throw new FileNotFoundException(new String(fileName));
+                    try {
+                        throw new FileNotFoundException(new String(fileName, "UTF-8"));
+                    } catch (java.io.UnsupportedEncodingException e) {
+                        throw new FileNotFoundException(new String(fileName));
+                    }
 		}
 		return handler;
 	}



Mime
View raw message