diff options
author | Arun Thondapu | 2017-05-31 07:14:10 +0000 |
---|---|---|
committer | Arun Thondapu | 2017-05-31 09:56:31 +0000 |
commit | dcd15a168596fb59b04dcb5896252b3429dff115 (patch) | |
tree | 96b9987f6855bac8f2c23633e25cbe191d8207cb /features/org.eclipse.equinox.executable.feature/library/eclipse.c | |
parent | a99892a2d73a61e494bb0bfe06129cec40f9ffc4 (diff) | |
download | rt.equinox.framework-dcd15a168596fb59b04dcb5896252b3429dff115.tar.gz rt.equinox.framework-dcd15a168596fb59b04dcb5896252b3429dff115.tar.xz rt.equinox.framework-dcd15a168596fb59b04dcb5896252b3429dff115.zip |
Bug 517507: Remove Java 9 hacks that were added to the launcher in
Oxygen M7
Revert "Bug 493761: Platform won't launch on Java 9-ea builds
(InjectionException: NoClassDefFoundError:
javax/annotation/PostConstruct)"
This reverts commit 4295e27d8e41283eadba7aa2e098126b22c5a7a9.
This reverts commit 28ff351cfc1b33eb84c70b295e8a86bf8b70d21f.
This reverts commit 2e0869c0e8cf5f4125a3237f22ed6f166a065fbb.
Diffstat (limited to 'features/org.eclipse.equinox.executable.feature/library/eclipse.c')
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/eclipse.c | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipse.c b/features/org.eclipse.equinox.executable.feature/library/eclipse.c index fb01ab71c..fa7db0cfc 100644 --- a/features/org.eclipse.equinox.executable.feature/library/eclipse.c +++ b/features/org.eclipse.equinox.executable.feature/library/eclipse.c @@ -252,8 +252,6 @@ home directory."); #define PERM_GEN _T_ECLIPSE("--launcher.XXMaxPermSize") #define XXPERMGEN _T_ECLIPSE("-XX:MaxPermSize=") -#define ADDMODULES _T_ECLIPSE("--add-modules") -#define PERMIT_ILLEGAL_ACCESS _T_ECLIPSE("--permit-illegal-access") #define ACTION_OPENFILE _T_ECLIPSE("openFile") #define GTK_VERSION _T_ECLIPSE("--launcher.GTK_version") @@ -1037,40 +1035,28 @@ static _TCHAR** mergeConfigurationFilesVMArgs() { } static void adjustVMArgs(_TCHAR *javaVM, _TCHAR *jniLib, _TCHAR **vmArgv[]) { - /* JVMs whose version is >= 9 need an extra VM argument (--add-modules) to start eclipse but earlier versions - * do not recognize this argument, remove it from the list of VM arguments when the JVM version is below 9 */ + /* Sun/Oracle VMs below version 8 need some extra perm gen space */ + /* Detecting Sun VM is expensive - only do so if necessary */ + if (permGen != NULL) { + int specified = 0, i = -1; + + /* first check to see if it is already specified */ + while ((*vmArgv)[++i] != NULL) { + /* we are also counting the number of args here */ + if (!specified && _tcsncmp((*vmArgv)[i], XXPERMGEN, _tcslen(XXPERMGEN)) == 0) { + specified = 1; + } + } - int i = 0; + if (!specified && isMaxPermSizeVM(javaVM, jniLib)) { + _TCHAR ** oldArgs = *vmArgv; + _TCHAR *newArg = malloc((_tcslen(XXPERMGEN) + _tcslen(permGen) + 1) * sizeof(_TCHAR)); + _stprintf(newArg, _T_ECLIPSE("%s%s"), XXPERMGEN, permGen); - if (!isModularVM(javaVM, jniLib)) { - while ((*vmArgv)[i] != NULL) { - if (_tcsncmp((*vmArgv)[i], ADDMODULES, _tcslen(ADDMODULES)) == 0 || _tcsncmp((*vmArgv)[i], PERMIT_ILLEGAL_ACCESS, _tcslen(PERMIT_ILLEGAL_ACCESS)) == 0) { - int j = 0, k = 0; - - if ((_tcschr((*vmArgv)[i], '=') != NULL) && ((*vmArgv)[i][13] == '=')) { - /* --add-modules=<value> */ - j = i + 1; - } else if (_tcslen(ADDMODULES) == _tcslen((*vmArgv)[i])) { - /* --add-modules <value> OR --add-modules <end-of-vmArgv> */ - ((*vmArgv)[i + 1] != NULL) ? (j = i + 2) : (j = i + 1); - } else if (_tcslen(PERMIT_ILLEGAL_ACCESS) == _tcslen((*vmArgv)[i])) { - /* --permit-illegal-access */ - j = i + 1; - } else { - /* Probable new argument e.g. --add-modules-if-required or misspelled argument e.g. --add-modulesq */ - i++; - continue; - } - - /* shift all remaining arguments, but keep i, so that we can find repeated occurrences of --add-modules */ - k = i; - (*vmArgv)[k] = (*vmArgv)[j]; - while ((*vmArgv)[j] != NULL) { - (*vmArgv)[++k] = (*vmArgv)[++j]; - } - } else { - i++; - } + *vmArgv = malloc((i + 2) * sizeof(_TCHAR *)); + memcpy(*vmArgv, oldArgs, i * sizeof(_TCHAR *)); + (*vmArgv)[i] = newArg; + (*vmArgv)[i + 1] = 0; } } } |