/hg/icedtea-web: Removed unused legacy-launcher sources

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Mon Feb 25 01:52:49 PST 2013


changeset 568458b32abe in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=568458b32abe
author: Jiri Vanek <jvanek at redhat.com>
date: Mon Feb 25 10:52:51 2013 +0100

	Removed unused legacy-launcher sources


diffstat:

 ChangeLog                     |    23 +
 launcher/java.c               |  2019 -----------------------------------------
 launcher/java.h               |   115 --
 launcher/java_md.c            |  1814 ------------------------------------
 launcher/java_md.h            |    73 -
 launcher/jli_util.c           |    83 -
 launcher/jli_util.h           |    36 -
 launcher/jni.h                |  1959 ---------------------------------------
 launcher/jni_md.h             |    42 -
 launcher/jvm.h                |  1501 ------------------------------
 launcher/jvm_md.h             |    77 -
 launcher/manifest_info.h      |   156 ---
 launcher/parse_manifest.c     |   610 ------------
 launcher/splashscreen.h       |    31 -
 launcher/splashscreen_stubs.c |    78 -
 launcher/version_comp.c       |   357 -------
 launcher/version_comp.h       |    37 -
 launcher/wildcard.c           |   495 ----------
 launcher/wildcard.h           |    35 -
 19 files changed, 23 insertions(+), 9518 deletions(-)

diffs (truncated from 9620 to 500 lines):

diff -r ad2e15f15a75 -r 568458b32abe ChangeLog
--- a/ChangeLog	Thu Feb 21 15:26:38 2013 -0500
+++ b/ChangeLog	Mon Feb 25 10:52:51 2013 +0100
@@ -1,3 +1,26 @@
+2013-02-25  Jiri Vanek  <jvanek at redhat.com>
+
+	Removed unused legacy-launcher sources
+	* launcher/java.c:
+	* launcher/java.h:
+	* launcher/java_md.c:
+	* launcher/java_md.h:
+	* launcher/jli_util.c:
+	* launcher/jli_util.h:
+	* launcher/jni.h:
+	* launcher/jni_md.h:
+	* launcher/jvm.h:
+	* launcher/jvm_md.h:
+	* launcher/manifest_info.h:
+	* launcher/parse_manifest.c:
+	* launcher/splashscreen.h:
+	* launcher/splashscreen_stubs.c:
+	* launcher/version_comp.c:
+	* launcher/version_comp.h:
+	* launcher/wildcard.c:
+	* launcher/wildcard.h:
+	Happily removed
+
 2013-02-21  Adam Domurad  <adomurad at redhat.com>
 
 	* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
diff -r ad2e15f15a75 -r 568458b32abe launcher/java.c
--- a/launcher/java.c	Thu Feb 21 15:26:38 2013 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2019 +0,0 @@
-/*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/*
- * Shared source for 'java' command line tool.
- *
- * If JAVA_ARGS is defined, then acts as a launcher for applications. For
- * instance, the JDK command line tools such as javac and javadoc (see
- * makefiles for more details) are built with this program.  Any arguments
- * prefixed with '-J' will be passed directly to the 'java' command.
- */
-
-/*
- * One job of the launcher is to remove command line options which the
- * vm does not understand and will not process.  These options include
- * options which select which style of vm is run (e.g. -client and
- * -server) as well as options which select the data model to use.
- * Additionally, for tools which invoke an underlying vm "-J-foo"
- * options are turned into "-foo" options to the vm.  This option
- * filtering is handled in a number of places in the launcher, some of
- * it in machine-dependent code.  In this file, the function
- * CheckJVMType removes vm style options and TranslateApplicationArgs
- * removes "-J" prefixes.  On unix platforms, the
- * CreateExecutionEnvironment function from the unix java_md.c file
- * processes and removes -d<n> options.  However, in case
- * CreateExecutionEnvironment does not need to exec because
- * LD_LIBRARY_PATH is set acceptably and the data model does not need
- * to be changed, ParseArguments will screen out the redundant -d<n>
- * options and prevent them from being passed to the vm; this is done
- * by using the machine-dependent call
- * RemovableMachineDependentOption.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <jni.h>
-#include <jvm.h>
-#include "java.h"
-#include "manifest_info.h"
-#include "version_comp.h"
-#include "wildcard.h"
-#include "splashscreen.h"
-
-#ifndef FULL_VERSION
-#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
-#endif
-
-/*
- * The following environment variable is used to influence the behavior
- * of the jre exec'd through the SelectVersion routine.  The command line
- * options which specify the version are not passed to the exec'd version,
- * because that jre may be an older version which wouldn't recognize them.
- * This environment variable is known to this (and later) version and serves
- * to suppress the version selection code.  This is not only for efficiency,
- * but also for correctness, since any command line options have been
- * removed which would cause any value found in the manifest to be used.
- * This would be incorrect because the command line options are defined
- * to take precedence.
- *
- * The value associated with this environment variable is the MainClass
- * name from within the executable jar file (if any). This is strictly a
- * performance enhancement to avoid re-reading the jar file manifest.
- *
- * A NOTE TO DEVELOPERS: For performance reasons it is important that
- * the program image remain relatively small until after SelectVersion
- * CreateExecutionEnvironment have finished their possibly recursive
- * processing. Watch everything, but resist all temptations to use Java
- * interfaces.
- */
-#define ENV_ENTRY "_JAVA_VERSION_SET"
-
-#define SPLASH_FILE_ENV_ENTRY "_JAVA_SPLASH_FILE"
-#define SPLASH_JAR_ENV_ENTRY "_JAVA_SPLASH_JAR"
-
-static jboolean printVersion = JNI_FALSE; /* print and exit */
-static jboolean showVersion = JNI_FALSE;  /* print but continue */
-static jboolean printUsage = JNI_FALSE;   /* print and exit*/
-static jboolean printXUsage = JNI_FALSE;  /* print and exit*/
-static char *progname;
-static char *launchername;
-jboolean _launcher_debug = JNI_FALSE;
-
-/*
- * Entries for splash screen environment variables.
- * putenv is performed in SelectVersion. We need
- * them in memory until UnsetEnv, so they are made static
- * global instead of auto local.
- */
-static char* splash_file_entry = NULL;
-static char* splash_jar_entry = NULL;
-
-/*
- * List of VM options to be specified when the VM is created.
- */
-static JavaVMOption *options;
-static int numOptions, maxOptions;
-
-/*
- * Prototypes for functions internal to launcher.
- */
-static void SetClassPath(const char *s);
-static void SelectVersion(int argc, char **argv, char **main_class);
-static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile,
-                               char **pclassname, int *pret, const char *jvmpath);
-static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv,
-                              InvocationFunctions *ifn);
-static jstring NewPlatformString(JNIEnv *env, char *s);
-static jobjectArray NewPlatformStringArray(JNIEnv *env, char **strv, int strc);
-static jclass LoadClass(JNIEnv *env, char *name);
-static jstring GetMainClassName(JNIEnv *env, char *jarname);
-static void SetJavaCommandLineProp(char* classname, char* jarfile, int argc, char** argv);
-static void SetJavaLauncherProp(void);
-
-#ifdef JAVA_ARGS
-static void TranslateApplicationArgs(int *pargc, char ***pargv);
-static jboolean AddApplicationOptions(void);
-#endif
-
-static void PrintJavaVersion(JNIEnv *env);
-static void PrintUsage(JNIEnv* env, jboolean doXUsage);
-
-static void SetPaths(int argc, char **argv);
-
-
-/* Maximum supported entries from jvm.cfg. */
-#define INIT_MAX_KNOWN_VMS      10
-/* Values for vmdesc.flag */
-#define VM_UNKNOWN              -1
-#define VM_KNOWN                 0
-#define VM_ALIASED_TO            1
-#define VM_WARN                  2
-#define VM_ERROR                 3
-#define VM_IF_SERVER_CLASS       4
-#define VM_IGNORE                5
-struct vmdesc {
-    char *name;
-    int flag;
-    char *alias;
-    char *server_class;
-};
-static struct vmdesc *knownVMs = NULL;
-static int knownVMsCount = 0;
-static int knownVMsLimit = 0;
-
-static void GrowKnownVMs();
-static int  KnownVMIndex(const char* name);
-static void FreeKnownVMs();
-static void ShowSplashScreen();
-
-jboolean ServerClassMachine();
-
-/* flag which if set suppresses error messages from the launcher */
-static int noExitErrorMessage = 0;
-
-/*
- * Running Java code in primordial thread caused many problems. We will
- * create a new thread to invoke JVM. See 6316197 for more information.
- */
-static jlong threadStackSize = 0;  /* stack size of the new thread */
-
-int JNICALL JavaMain(void * args); /* entry point                  */
-
-struct JavaMainArgs {
-  int     argc;
-  char ** argv;
-  char *  jarfile;
-  char *  classname;
-  InvocationFunctions ifn;
-};
-
-/*
- * Entry point.
- */
-int
-main(int argc, char ** argv)
-{
-    char *jarfile = 0;
-    char *classname = 0;
-    char *s = 0;
-    char *main_class = NULL;
-    int ret;
-    InvocationFunctions ifn;
-    jlong start, end;
-    char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN];
-    char ** original_argv = argv;
-
-    if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) {
-      int i;
-      _launcher_debug = JNI_TRUE;
-      printf("----_JAVA_LAUNCHER_DEBUG----\n");
-      printf("Command line Args:\n");
-      for(i = 0; i < argc+1; i++) {
-        if (argv[i] != NULL){
-          printf("\targv[%d] = '%s'\n",i,argv[i]);
-        }
-      }
-    }
-
-
-
-    /*
-     * Make sure the specified version of the JRE is running.
-     *
-     * There are three things to note about the SelectVersion() routine:
-     *  1) If the version running isn't correct, this routine doesn't
-     *     return (either the correct version has been exec'd or an error
-     *     was issued).
-     *  2) Argc and Argv in this scope are *not* altered by this routine.
-     *     It is the responsibility of subsequent code to ignore the
-     *     arguments handled by this routine.
-     *  3) As a side-effect, the variable "main_class" is guaranteed to
-     *     be set (if it should ever be set).  This isn't exactly the
-     *     poster child for structured programming, but it is a small
-     *     price to pay for not processing a jar file operand twice.
-     *     (Note: This side effect has been disabled.  See comment on
-     *     bugid 5030265 below.)
-     */
-    SelectVersion(argc, argv, &main_class);
-
-    /* copy original argv */
-    {
-      int i;
-      original_argv = (char**)JLI_MemAlloc(sizeof(char*)*(argc+1));
-      for(i = 0; i < argc+1; i++) {
-        original_argv[i] = argv[i];
-      }
-    }
-
-    CreateExecutionEnvironment(&argc, &argv,
-                               jrepath, sizeof(jrepath),
-                               jvmpath, sizeof(jvmpath),
-                               original_argv);
-
-    ifn.CreateJavaVM = 0;
-    ifn.GetDefaultJavaVMInitArgs = 0;
-
-    if (_launcher_debug)
-      start = CounterGet();
-    if (!LoadJavaVM(jvmpath, &ifn)) {
-      exit(6);
-    }
-    if (_launcher_debug) {
-      end   = CounterGet();
-      printf("%ld micro seconds to LoadJavaVM\n",
-             (long)(jint)Counter2Micros(end-start));
-    }
-
-#ifdef JAVA_ARGS  /* javac, jar and friends. */
-    progname = "java";
-#else             /* java, oldjava, javaw and friends */
-#ifdef PROGNAME
-    progname = PROGNAME;
-#else
-    progname = *argv;
-    if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
-        progname = s + 1;
-    }
-#endif /* PROGNAME */
-#endif /* JAVA_ARGS */
-
-#ifdef LAUNCHER_NAME
-    launchername = LAUNCHER_NAME;
-#else
-    launchername = progname;
-#endif /* LAUNCHER_NAME */
-
-    ++argv;
-    --argc;
-
-#ifdef JAVA_ARGS
-    /* Preprocess wrapper arguments */
-    TranslateApplicationArgs(&argc, &argv);
-    if (!AddApplicationOptions()) {
-        exit(1);
-    }
-#endif
-
-    /* Set default CLASSPATH */
-    if ((s = getenv("CLASSPATH")) == 0) {
-        s = ".";
-    }
-#ifndef JAVA_ARGS
-    SetClassPath(s);
-#endif
-
-    /*
-     *  Parse command line options; if the return value of
-     *  ParseArguments is false, the program should exit.
-     */
-    if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret, jvmpath)) {
-      exit(ret);
-    }
-
-    /* Override class path if -jar flag was specified */
-    if (jarfile != 0) {
-        SetClassPath(jarfile);
-    }
-
-    /* set the -Dsun.java.command pseudo property */
-    SetJavaCommandLineProp(classname, jarfile, argc, argv);
-
-    /* Set the -Dsun.java.launcher pseudo property */
-    SetJavaLauncherProp();
-
-    /* set the -Dsun.java.launcher.* platform properties */
-    SetJavaLauncherPlatformProps();
-
-    /* Show the splash screen if needed */
-    ShowSplashScreen();
-
-    /*
-     * Done with all command line processing and potential re-execs so
-     * clean up the environment.
-     */
-    (void)UnsetEnv(ENV_ENTRY);
-    (void)UnsetEnv(SPLASH_FILE_ENV_ENTRY);
-    (void)UnsetEnv(SPLASH_JAR_ENV_ENTRY);
-
-    JLI_MemFree(splash_jar_entry);
-    JLI_MemFree(splash_file_entry);
-
-    /*
-     * If user doesn't specify stack size, check if VM has a preference.
-     * Note that HotSpot no longer supports JNI_VERSION_1_1 but it will
-     * return its default stack size through the init args structure.
-     */
-    if (threadStackSize == 0) {
-      struct JDK1_1InitArgs args1_1;
-      memset((void*)&args1_1, 0, sizeof(args1_1));
-      args1_1.version = JNI_VERSION_1_1;
-      ifn.GetDefaultJavaVMInitArgs(&args1_1);  /* ignore return value */
-      if (args1_1.javaStackSize > 0) {
-         threadStackSize = args1_1.javaStackSize;
-      }
-    }
-
-    { /* Create a new thread to create JVM and invoke main method */
-      struct JavaMainArgs args;
-
-      args.argc = argc;
-      args.argv = argv;
-      args.jarfile = jarfile;
-      args.classname = classname;
-      args.ifn = ifn;
-
-      return ContinueInNewThread(JavaMain, threadStackSize, (void*)&args, ret);
-    }
-}
-
-int JNICALL
-JavaMain(void * _args)
-{
-    struct JavaMainArgs *args = (struct JavaMainArgs *)_args;
-    int argc = args->argc;
-    char **argv = args->argv;
-    char *jarfile = args->jarfile;
-    char *classname = args->classname;
-    InvocationFunctions ifn = args->ifn;
-
-    JavaVM *vm = 0;
-    JNIEnv *env = 0;
-    jstring mainClassName;
-    jclass mainClass;
-    jmethodID mainID;
-    jobjectArray mainArgs;
-    int ret = 0;
-    jlong start, end;
-
-    /*
-     * Error message to print or display; by default the message will
-     * only be displayed in a window.
-     */
-    char * message = "Fatal exception occurred.  Program will exit.";
-    jboolean messageDest = JNI_FALSE;
-
-    /* Initialize the virtual machine */
-
-    if (_launcher_debug)
-        start = CounterGet();
-    if (!InitializeJVM(&vm, &env, &ifn)) {
-        ReportErrorMessage("Could not create the Java virtual machine.",
-                           JNI_TRUE);
-        exit(1);
-    }
-
-    if (printVersion || showVersion) {
-        PrintJavaVersion(env);
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            goto leave;
-        }
-        if (printVersion) {
-            ret = 0;
-            message = NULL;
-            goto leave;
-        }
-        if (showVersion) {
-            fprintf(stderr, "\n");
-        }
-    }
-
-    /* If the user specified neither a class name nor a JAR file */
-    if (printXUsage || printUsage || (jarfile == 0 && classname == 0)) {
-        PrintUsage(env, printXUsage);
-        if ((*env)->ExceptionOccurred(env)) {
-            ReportExceptionDescription(env);
-            ret=1;
-        }
-        message = NULL;
-        goto leave;
-    }
-
-
-
-    FreeKnownVMs();  /* after last possible PrintUsage() */
-
-    if (_launcher_debug) {
-        end   = CounterGet();
-        printf("%ld micro seconds to InitializeJVM\n",
-               (long)(jint)Counter2Micros(end-start));
-    }
-
-    /* At this stage, argc/argv have the applications' arguments */
-    if (_launcher_debug) {
-        int i = 0;
-        printf("Main-Class is '%s'\n", classname ? classname : "");
-        printf("Apps' argc is %d\n", argc);
-        for (; i < argc; i++) {
-            printf("    argv[%2d] = '%s'\n", i, argv[i]);
-        }
-    }
-
-    ret = 1;
-
-    /*
-     * Get the application's main class.
-     *
-     * See bugid 5030265.  The Main-Class name has already been parsed
-     * from the manifest, but not parsed properly for UTF-8 support.
-     * Hence the code here ignores the value previously extracted and
-     * uses the pre-existing code to reextract the value.  This is
-     * possibly an end of release cycle expedient.  However, it has



More information about the distro-pkg-dev mailing list