harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r464443 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
Date Mon, 16 Oct 2006 10:53:27 GMT
Author: tellison
Date: Mon Oct 16 03:53:22 2006
New Revision: 464443

URL: http://svn.apache.org/viewvc?view=rev&rev=464443
Log:
Apply patch HARMONY-1819 ([launcher] Raised exceptions should not be explicitly printed by
the launcher)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c?view=diff&rev=464443&r1=464442&r2=464443
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
Mon Oct 16 03:53:22 2006
@@ -602,7 +602,6 @@
   JavaVM *jvm;
   JNIEnv *env;
   char *mainClassJar;
-  int javaRc = 0;
   int isNameUTF = 0;
   int rc;
   jint (JNICALL * CreateJavaVM) (JavaVM **, JNIEnv **, JavaVMInitArgs *);
@@ -648,19 +647,15 @@
           
           if (!jStrObject)
             {
-              (*env)->ExceptionDescribe (env);
-              (*jvm)->DestroyJavaVM (jvm);
               rc = 3;
-              //goto cleanup;
+              goto cleanup;
             }
 
           clazz = (*env)->FindClass (env, "java/lang/Class");
           if (!clazz)
             {
-              (*env)->ExceptionDescribe (env);
-              (*jvm)->DestroyJavaVM (jvm);
               rc = 3;
-              //goto cleanup;
+              goto cleanup;
             }
 
           mID =
@@ -668,10 +663,8 @@
                                        "(Ljava/lang/String;)Ljava/lang/Class;");
           if (!mID)
             {
-              (*env)->ExceptionDescribe (env);
-              (*jvm)->DestroyJavaVM (jvm);
               rc = 3;
-              //goto cleanup;
+              goto cleanup;
             }
 
           /* ensure that the jar is the first arg passed to the jar runner */
@@ -702,11 +695,12 @@
             */
         }
 
-      javaRc =
+      rc =
         main_runJavaMain (env, mainClass, isNameUTF, (argc - (classArg + 1)),
                           &argv[classArg + 1], portLibrary);
 
     }
+cleanup:
   if (vm_args.options)
     {
       hymem_free_memory (vm_args.options);
@@ -715,14 +709,14 @@
     {
       hymem_free_memory (mainClassJar);
     }
-
+  (*jvm)->DetachCurrentThread(jvm);
   (*jvm)->DestroyJavaVM (jvm);
   /*if ((*jvm)->DestroyJavaVM(jvm)) {
      hytty_printf (PORTLIB, "Failed to destroy JVM\n");
      return 1;
      } */
 
-  return 0;
+  return rc;
 }
 
  /**
@@ -1258,8 +1252,6 @@
     {
       if (rc == 0)
         rc = 100;
-
-      (*env)->ExceptionDescribe (env);
     }
 
   return rc;



Mime
View raw message