diff options
author | Joachim Lingner <jl@openoffice.org> | 2002-11-13 15:04:59 +0000 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2002-11-13 15:04:59 +0000 |
commit | 712934b2cc185c19c996989b88925dfc2ea4f6b4 (patch) | |
tree | 83366758d600c322aa1d9a986ff2d8233574b50d /stoc | |
parent | dc93f1158e39dfb2923dc021b53ae2773ed2b726 (diff) |
#105085# -Xdebug, etc. entries in java.ini are not read
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/javavm/javavm.cxx | 77 | ||||
-rw-r--r-- | stoc/source/javavm/jvmargs.cxx | 126 |
2 files changed, 111 insertions, 92 deletions
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index ef5df126e..b712fd546 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: javavm.cxx,v $ * - * $Revision: 1.45 $ + * $Revision: 1.46 $ * - * last change: $Author: jl $ $Date: 2002-11-12 16:07:33 $ + * last change: $Author: jl $ $Date: 2002-11-13 16:04:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1091,44 +1091,53 @@ static void getJavaPropsFromConfig(JVM * pjvm, else break; } - + //Read each line from the Java section - while(1) + if(bSectionFound) { - ByteSequence seq; - if(pIniFile->readLine(seq) == File::E_None) + while(1) { - sal_Bool bEOF; - pIniFile->isEndOfFile(&bEOF); - if(bEOF) - break; - //check if another Section starts - OString line((sal_Char*)seq.getArray(), seq.getLength()); - if(line.indexOf('[') == 0) + ByteSequence seq; + if(pIniFile->readLine(seq) == File::E_None) + { + //check if another Section starts + OString line((sal_Char*)seq.getArray(), seq.getLength()); + if(line.indexOf('[') == 0) + break; + //check if there is '=' after the first word + bool bOk= false; + const sal_Char *pIndex= line.getStr(); + //check for jvm options, e.g. -Xdebug, -D, .. + if( *pIndex != '-') + { + //no jvm option, check for property, e.g RuntimeLib=XXX + sal_Int32 len= line.getLength(); + const sal_Char *pEnd= pIndex + len; + //the line must not contain spaces or tabs + while( pIndex != pEnd + && *pIndex != ' ' + && *pIndex != '\t' + && *pIndex != '=') + pIndex ++; + if(pIndex == pEnd || *pIndex != '=') + continue; // no '=' found + } + // Ok, store the line + line.trim(); + OUString usProp= OStringToOUString(line, osl_getThreadTextEncoding()); + pjvm->pushProp(usProp); + + sal_Bool bEOF; + pIniFile->isEndOfFile(&bEOF); + if(bEOF) + break; + } + else break; - //check if there is '=' after the first word - bool bOk= false; - const sal_Char *pIndex= line.getStr(); - sal_Int32 len= line.getLength(); - const sal_Char *pEnd= pIndex + len; - while( pIndex != pEnd - && *pIndex != ' ' - && *pIndex != '\t' - && *pIndex != '=') - pIndex ++; - if(pIndex == pEnd || *pIndex != '=') - continue; // no '=' found - - // Ok, store the line - line.trim(); - OUString usProp= OStringToOUString(line, osl_getThreadTextEncoding()); - pjvm->pushProp(usProp); } - else - break; + pIniFile->close(); + delete pIniFile; } - pIniFile->close(); - delete pIniFile; } static const Bootstrap & getBootstrapHandle() diff --git a/stoc/source/javavm/jvmargs.cxx b/stoc/source/javavm/jvmargs.cxx index b68f1e63b..38639521b 100644 --- a/stoc/source/javavm/jvmargs.cxx +++ b/stoc/source/javavm/jvmargs.cxx @@ -2,9 +2,9 @@ * * $RCSfile: jvmargs.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: jl $ $Date: 2002-08-15 13:26:07 $ + * last change: $Author: jl $ $Date: 2002-11-13 16:04:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -100,10 +100,13 @@ namespace stoc_javavm { { } - void JVM::pushProp(const OUString & property) throw() { + void JVM::pushProp(const OUString & property) throw() + { sal_Int32 index = property.indexOf((sal_Unicode)'='); - OUString left = property.copy(0, index).trim(); - OUString right(property.copy(index + 1).trim()); + if(index > 0) + { + OUString left = property.copy(0, index).trim(); + OUString right(property.copy(index + 1).trim()); // #ifdef DEBUG // OString left_tmp = OUStringToOString(left, RTL_TEXTENCODING_ASCII_US); @@ -112,64 +115,71 @@ namespace stoc_javavm { // OSL_TRACE("javam - right %s", right_tmp.getStr()); // #endif - if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Debug")))) - setDebugPort(1199); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Java")))) - setEnabled(right.toInt32()); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Version")))) - ; - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Home")))) - _java_home = right; - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("VMType")))) - _vmtype = right; - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("SystemClasspath")))) - addSystemClasspath(right); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("UserClasspath")))) - addUserClasspath(right); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("DisableAsyncGC")))) - setDisableAsyncGC(right.toInt32()); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("EnableClassGC")))) - setEnableClassGC(right.toInt32()); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("EnableVerboseGC")))) - setEnableVerboseGC(right.toInt32()); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("NativeStackSize")))) - setNativeStackSize(right.toInt32()); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("JavaStackSize")))) - setJavaStackSize(right.toInt32()); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("VerifyMode")))) - setVerifyMode(right); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("MinHeapSize")))) - setMinHeapSize(right.toInt32()); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("MaxHeapSize")))) - setMaxHeapSize(right.toInt32()); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("DebugPort")))) + if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Debug")))) + setDebugPort(1199); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Java")))) + setEnabled(right.toInt32()); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Version")))) + ; + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Home")))) + _java_home = right; + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("VMType")))) + _vmtype = right; + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("SystemClasspath")))) + addSystemClasspath(right); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("UserClasspath")))) + addUserClasspath(right); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("DisableAsyncGC")))) + setDisableAsyncGC(right.toInt32()); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("EnableClassGC")))) + setEnableClassGC(right.toInt32()); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("EnableVerboseGC")))) + setEnableVerboseGC(right.toInt32()); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("NativeStackSize")))) + setNativeStackSize(right.toInt32()); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("JavaStackSize")))) + setJavaStackSize(right.toInt32()); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("VerifyMode")))) + setVerifyMode(right); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("MinHeapSize")))) + setMinHeapSize(right.toInt32()); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("MaxHeapSize")))) + setMaxHeapSize(right.toInt32()); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("DebugPort")))) setDebugPort(right.toInt32()); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("RuntimeLib")))) - setRuntimeLib(right); - - else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("CheckSource")))) - setCheckSource(right.toInt32()); - + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("RuntimeLib")))) + setRuntimeLib(right); + + else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("CheckSource")))) + setCheckSource(right.toInt32()); + + else + _props.push_back(property); + } else + { // no '=', could be -X _props.push_back(property); + } + } + void JVM::setEnabled(sal_Bool sbFlag) throw() { _enabled = sbFlag; } |