harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r776013 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java
Date Mon, 18 May 2009 17:13:36 GMT
Author: odeakin
Date: Mon May 18 17:13:36 2009
New Revision: 776013

URL: http://svn.apache.org/viewvc?rev=776013&view=rev
Log:
UnsupportedEncodingException should never occur for UTF-8, so throw AssertionError containing
the original chained exceptions.

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=776013&r1=776012&r2=776013&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
Mon May 18 17:13:36 2009
@@ -239,7 +239,10 @@
                     try {
                         throw new FileNotFoundException(new String(fileName, "UTF-8"));
                     } catch (java.io.UnsupportedEncodingException e) {
-                        throw new FileNotFoundException(new String(fileName));
+                        // UTF-8 should always be supported, so throw an assertion
+                        FileNotFoundException fnfe = new FileNotFoundException(new String(fileName));
+                        e.initCause(fnfe);
+                        throw new AssertionError(e);
                     }
 		}
 		return handler;



Mime
View raw message