summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2002-11-13 15:04:59 +0000
committerJoachim Lingner <jl@openoffice.org>2002-11-13 15:04:59 +0000
commit908798a484c6af3af45ebc1c6a5399261668f26e (patch)
tree32cdfed9b365726bf63fd39780da90d71d25af16 /stoc
parented6056cf4874c722673fbd9cbaa009a13e559663 (diff)
#105085# -Xdebug, etc. entries in java.ini are not read
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/javavm/javavm.cxx75
-rw-r--r--stoc/source/javavm/jvmargs.cxx90
2 files changed, 92 insertions, 73 deletions
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index c96449df3842..4e5546e8f880 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
@@ -1093,42 +1093,51 @@ static void getJavaPropsFromConfig(JVM * pjvm,
}
//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 b9bf7799dfed..38ab4e29b984 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);
+ 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("Java"))))
+ setEnabled(right.toInt32());
- else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("Version"))))
- ;
+ 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("Home"))))
+ _java_home = right;
- else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("VMType"))))
- _vmtype = 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("SystemClasspath"))))
+ addSystemClasspath(right);
- else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("UserClasspath"))))
- addUserClasspath(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("DisableAsyncGC"))))
+ setDisableAsyncGC(right.toInt32());
- else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("EnableClassGC"))))
- setEnableClassGC(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("EnableVerboseGC"))))
+ setEnableVerboseGC(right.toInt32());
- else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("NativeStackSize"))))
- setNativeStackSize(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("JavaStackSize"))))
+ setJavaStackSize(right.toInt32());
- else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("VerifyMode"))))
- setVerifyMode(right);
+ 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("MinHeapSize"))))
+ setMinHeapSize(right.toInt32());
- else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("MaxHeapSize"))))
- setMaxHeapSize(right.toInt32());
+ else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("MaxHeapSize"))))
+ setMaxHeapSize(right.toInt32());
- else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("DebugPort"))))
+ 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("RuntimeLib"))))
+ setRuntimeLib(right);
- else if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("CheckSource"))))
- setCheckSource(right.toInt32());
+ 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;
}