harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r782693 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main: java/org/apache/harmony/luni/util/Version.java native/launcher/shared/main.c
Date Mon, 08 Jun 2009 16:21:29 GMT
Author: hindessm
Date: Mon Jun  8 16:21:28 2009
New Revision: 782693

URL: http://svn.apache.org/viewvc?rev=782693&view=rev
Log:
Temporarily reverting r763589 so that "java -version" works for M10.

Removed:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/util/Version.java
Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c?rev=782693&r1=782692&r2=782693&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c Mon
Jun  8 16:21:28 2009
@@ -58,7 +58,7 @@
 PROTOTYPE ((HyPortLibrary * portLibrary, int argc, char **argv, UDATA handle,
             jint version, jboolean ignoreUnrecognized, char *mainClass,
             UDATA classArg, char *propertiesFileName,
-            int isStandaloneJar, char *vmdllsubdir, int versionFlag));
+            int isStandaloneJar, char *vmdllsubdir));
 static int createVMArgs
 PROTOTYPE ((HyPortLibrary * portLibrary, int argc, char **argv,
             jint version, jboolean ignoreUnrecognized,
@@ -227,9 +227,8 @@
 			/* The arg is a JAR file to run */
 			isStandaloneJar = 1;
 		}
-		if (0 == strncmp ("-version", argv[i], 8)) {
-            /* Display version information */
-            versionFlag = i;
+		if (0 == strcmp ("-version", argv[i])) {
+            versionFlag = 1;
 		}
 		if (0 == strcmp ("-showversion", argv[i])) {
 			/* We are being asked to print our version and continue */
@@ -364,6 +363,12 @@
         }
     }
     
+  if (versionFlag == 1) {
+    /* 
+     * We are being asked to print our version, and quit 
+     */
+    hyfile_printf (PORTLIB, HYPORT_TTY_OUT, HY_COPYRIGHT_STRING "\n");    
+  }
   /* set up the properties file */
   propertiesFileName = hymem_allocate_memory (strlen (vmiPath) + 12);
   if (propertiesFileName == NULL)
@@ -387,7 +392,7 @@
   /* main launcher processing in this function */
   rc = invocation
       (PORTLIB, argc, argv, handle, JNI_VERSION_1_4, JNI_TRUE, mainClass,
-       classArg, propertiesFileName, isStandaloneJar, vmdllsubdir, versionFlag);
+       classArg, propertiesFileName, isStandaloneJar, vmdllsubdir);
   if (rc)
     {
 	  /* Print an error message except in the case where an uncaught Exception 
@@ -637,7 +642,7 @@
 invocation (HyPortLibrary * portLibrary, int argc, char **argv, UDATA handle,
             jint version, jboolean ignoreUnrecognized, char *mainClass,
             UDATA classArg, char *propertiesFileName,
-            int isStandaloneJar, char *vmdllsubdir, int versionFlag)
+            int isStandaloneJar, char *vmdllsubdir)
 {
   JavaVMInitArgs vm_args;
   JavaVM *jvm;
@@ -673,27 +678,6 @@
     }
 
   rc = 0;
-
-  if (versionFlag) {
-      jclass clazz;
-      jmethodID mID;
-      jstring jStrObject;
-        
-      jStrObject = (*env)->NewStringUTF (env, argv[versionFlag]);
-      if (!jStrObject) return 3;
-        
-      clazz = (*env)->FindClass (env, "org/apache/harmony/luni/util/Version");
-      if (!clazz) return 3;
-        
-      mID = (*env)->GetStaticMethodID (env, clazz, "version",
-                         "(Ljava/lang/String;)V");
-      if (!mID) return 3;
-        
-      (*env)->CallStaticVoidMethod(env, clazz, mID, jStrObject);
-        
-      return 0;
-  }
-
   if (mainClass)
     {
       if (isStandaloneJar)
@@ -968,8 +952,7 @@
    {
        if ( (strcmp (argv[i], "-jar") != 0) 
            && (strncmp (argv[i], "-vmdir:", 7) != 0)
-           && (strncmp (argv[i], "-vm:", 4) != 0) 
-           && (strncmp (argv[i], "-version", 8) != 0))
+           && (strncmp (argv[i], "-vm:", 4) != 0) )
        {
           /* special coding for -classpath and -cp */
           /* they get passed to the vm as -Djava.class.path */



Mime
View raw message