You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by od...@apache.org on 2009/05/18 19:13:36 UTC

svn commit: r776013 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java

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;