Clarify cause of 071 failure with an UNIMPLEMENTED

Change-Id: I6b76a53a44bb2c26fc226ef32628a63944db3dbe
diff --git a/src/dalvik_system_DexFile.cc b/src/dalvik_system_DexFile.cc
index 9b29d25..bb486e2 100644
--- a/src/dalvik_system_DexFile.cc
+++ b/src/dalvik_system_DexFile.cc
@@ -36,7 +36,7 @@
 // passed a null jstring. The correct idiom is:
 //
 //   NullableScopedUtfChars name(env, javaName);
-//   if (env->ExceptionOccurred()) {
+//   if (env->ExceptionCheck()) {
 //       return NULL;
 //   }
 //   // ... use name.c_str()
@@ -85,9 +85,13 @@
     return 0;
   }
   NullableScopedUtfChars outputName(env, javaOutputName);
-  if (env->ExceptionOccurred()) {
+  if (env->ExceptionCheck()) {
     return 0;
   }
+  if (outputName.c_str() != NULL) {
+    // TODO: extract dex and run dex2oat like oatopt
+    UNIMPLEMENTED(FATAL) << sourceName.c_str() << " " << outputName.c_str();
+  }
   const DexFile* dex_file = DexFile::Open(sourceName.c_str(), "");
   if (dex_file == NULL) {
     jniThrowExceptionFmt(env, "java/io/IOException", "unable to open DEX file: %s",
diff --git a/test/071-dexfile/src/Main.java b/test/071-dexfile/src/Main.java
index d71aec0..2cbe380 100644
--- a/test/071-dexfile/src/Main.java
+++ b/test/071-dexfile/src/Main.java
@@ -54,8 +54,9 @@
             testDexClassLoader();
         } finally {
             // shouldn't be necessary, but it's good to be tidy
-            if (p != null)
+            if (p != null) {
                 p.destroy();
+            }
 
             // let the ProcessManager's daemon thread finish before we shut down
             // (avoids the occasional segmentation fault)
@@ -78,7 +79,7 @@
         try {
             anotherClass = dexClassLoader.loadClass("Another");
         } catch (ClassNotFoundException cnfe) {
-            throw new RuntimeException("Another?");
+            throw new RuntimeException("Another?", cnfe);
         }
 
         Object another;
@@ -102,26 +103,30 @@
     private static ClassLoader getDexClassLoader() {
         String odexDir;
 
-        /*
-        String androidData = System.getenv("ANDROID_DATA");
-        if (androidData == null)
-            androidData = "";
-        odexDir = androidData + "/" + ODEX_DIR;
-        */
+        if (false) {
+            String androidData = System.getenv("ANDROID_DATA");
+            if (androidData == null) {
+                androidData = "";
+            }
+            odexDir = androidData + "/" + ODEX_DIR;
+        }
 
         File test = new File(ODEX_DIR);
-        if (test.isDirectory())
+        if (test.isDirectory()) {
             odexDir = ODEX_DIR;
-        else
+        } else {
             odexDir = ODEX_ALT;
-        //System.out.println("Output dir is " + odexDir);
+        }
+        if (false) {
+            System.out.println("Output dir is " + odexDir);
+        }
 
         ClassLoader myLoader = Main.class.getClassLoader();
         Class dclClass;
         try {
             dclClass = myLoader.loadClass("dalvik.system.DexClassLoader");
         } catch (ClassNotFoundException cnfe) {
-            throw new RuntimeException("dalvik.system.DexClassLoader not found");
+            throw new RuntimeException("dalvik.system.DexClassLoader not found", cnfe);
         }
 
         Constructor ctor;