diff options
Diffstat (limited to 'jvmfwk/plugins')
19 files changed, 161 insertions, 161 deletions
diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx index 2c13780ad421..3f9fb9fca345 100644 --- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx +++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -78,7 +78,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) return -1; } - + JavaInfo * pInfo = NULL; errcode = jfw_getSelectedJRE( & pInfo); @@ -92,7 +92,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) fprintf(stderr,"javaldx failed! \n"); return -1; } - + if (pInfo == NULL) { if (false == findAndSelect(&pInfo)) @@ -114,7 +114,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) return -1; } } - + //Only do something if the sunjavaplugin created this JavaInfo rtl::OUString sVendor1(RTL_CONSTASCII_USTRINGPARAM("Sun Microsystems Inc.")); rtl::OUString sVendor2(RTL_CONSTASCII_USTRINGPARAM("IBM Corporation")); @@ -133,11 +133,11 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) || sVendor7.equals(pInfo->sVendor) == sal_True || sVendor8.equals(pInfo->sVendor) == sal_True)) return 0; - + rtl::OString sPaths = getLD_LIBRARY_PATH(pInfo->arVendorData); fprintf(stdout, "%s\n", sPaths.getStr()); jfw_freeJavaInfo(pInfo); - + return 0; } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java index b0930e1c93f3..28b67945ac78 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java +++ b/jvmfwk/plugins/sunmajor/pluginlib/JREProperties.java @@ -30,8 +30,8 @@ public class JREProperties //#i44608. boolean bW98 = false; String os = System.getProperty("os.name"); - - if (os != null) + + if (os != null) { os = os.trim(); if (os.equalsIgnoreCase("Windows 98") || @@ -48,7 +48,7 @@ public class JREProperties if (bNoAccess == false && ! bW98) { try{ - //This line is needed to get the accessibility properties + //This line is needed to get the accessibility properties Toolkit tk = java.awt.Toolkit.getDefaultToolkit(); } catch(Throwable e) @@ -81,5 +81,5 @@ public class JREProperties } - + } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h b/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h index 6a8ef3232bc4..ae7796d94065 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h +++ b/jvmfwk/plugins/sunmajor/pluginlib/diagnostics.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx index f97fba340cc4..4fb35d49c4af 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -79,7 +79,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) { //get java.vendor, java.version, java.home, //javax.accessibility.assistive_technologies from system properties - + OUString sVendor; OUString sJavaLibraryPath; typedef vector<pair<OUString, OUString> >::const_iterator it_prop; @@ -164,11 +164,11 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) // init m_sRuntimeLibrary OSL_ASSERT(m_sHome.getLength()); //call virtual function to get the possible paths to the runtime library. - + int size = 0; char const* const* arRtPaths = getRuntimePaths( & size); vector<OUString> libpaths = getVectorFromCharArray(arRtPaths, size); - + bool bRt = false; typedef vector<OUString>::const_iterator i_path; for(i_path ip = libpaths.begin(); ip != libpaths.end(); ip++) @@ -276,7 +276,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) } if (bLdPath == false) return false; - + return true; } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx index 413ff4bd1c38..80bca6c29628 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx index 9da3df2a2fdc..152d4431e8bc 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -93,7 +93,7 @@ char const* const* OtherInfo::getRuntimePaths(int * size) char const* const* OtherInfo::getLibraryPaths(int* size) { -#ifdef UNX +#ifdef UNX static char const * ar[] = { #ifdef MACOSX //mac version does not have a ld library path anymore @@ -121,7 +121,7 @@ char const* const* OtherInfo::getLibraryPaths(int* size) int OtherInfo::compareVersions(const rtl::OUString& /*sSecond*/) const { - //Need to provide an own algorithm for comparing version. + //Need to provide an own algorithm for comparing version. //Because this function returns always 0, which means the version of //this JRE and the provided version "sSecond" are equal, one cannot put //any excludeVersion entries in the javavendors.xml file. diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx index 9f54cf0ea5eb..7211ad11f679 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index cff9cdfa05af..1ff9766af6c3 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,13 +65,13 @@ using namespace jfw_plugin; namespace { -struct PluginMutex: public ::rtl::Static<osl::Mutex, PluginMutex> {}; +struct PluginMutex: public ::rtl::Static<osl::Mutex, PluginMutex> {}; #if defined UNX OString getPluginJarPath( const OUString & sVendor, const OUString& sLocation, - const OUString& sVersion) + const OUString& sVersion) { OString ret; OUString sName1(RTL_CONSTASCII_USTRINGPARAM("javaplugin.jar")); @@ -83,7 +83,7 @@ OString getPluginJarPath( SunVersion ver150("1.5.0-ea"); SunVersion ver(sVersion); OSL_ASSERT(ver142 && ver150 && ver); - + OUString sName; if (ver < ver142) { @@ -116,12 +116,12 @@ OString getPluginJarPath( == osl_File_E_None) { sPath = sPath1 + OUString::createFromAscii(sep) + sPath2; - } + } } OSL_ASSERT(sPath.getLength()); } ret = rtl::OUStringToOString(sPath, osl_getThreadTextEncoding()); - + return ret; } #endif // UNX @@ -151,7 +151,7 @@ JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info) buf.append(info->getLibraryPaths()); buf.appendAscii("\n"); } - + rtl::OUString sVendorData = buf.makeStringAndClear(); rtl::ByteSequence byteSeq( (sal_Int8*) sVendorData.pData->buffer, sVendorData.getLength() * sizeof(sal_Unicode)); @@ -159,7 +159,7 @@ JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info) rtl_byte_sequence_acquire(pInfo->arVendorData); return pInfo; -} +} rtl::OUString getRuntimeLib(const rtl::ByteSequence & data) { @@ -169,7 +169,7 @@ rtl::OUString getRuntimeLib(const rtl::ByteSequence & data) //the runtime lib is on the first line sal_Int32 index = 0; rtl::OUString aToken = sData.getToken( 0, '\n', index); - + return aToken; } @@ -228,14 +228,14 @@ javaPluginError jfw_plugin_getAllJavaInfos( getAllJREInfos(); vector<rtl::Reference<VendorBase> > vecVerifiedInfos; - typedef vector<rtl::Reference<VendorBase> >::iterator it; + typedef vector<rtl::Reference<VendorBase> >::iterator it; for (it i= vecInfos.begin(); i != vecInfos.end(); i++) { const rtl::Reference<VendorBase>& cur = *i; - + if (ouVendor.equals(cur->getVendor()) == sal_False) continue; - + if (ouMinVer.getLength() > 0) { try @@ -249,11 +249,11 @@ javaPluginError jfw_plugin_getAllJavaInfos( JFW_ENSURE( 0,OUSTR("[Java framework]sunjavaplugin does not know version: ") + ouMinVer + OUSTR(" for vendor: ") + cur->getVendor() - + OUSTR(" .Check minimum Version.") ); + + OUSTR(" .Check minimum Version.") ); return JFW_PLUGIN_E_WRONG_VERSION_FORMAT; } } - + if (ouMaxVer.getLength() > 0) { try @@ -271,7 +271,7 @@ javaPluginError jfw_plugin_getAllJavaInfos( return JFW_PLUGIN_E_WRONG_VERSION_FORMAT; } } - + if (arExcludeList > 0) { bool bExclude = false; @@ -328,7 +328,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( JavaInfo ** ppInfo) { javaPluginError errcode = JFW_PLUGIN_E_NONE; - + OSL_ASSERT(path); OSL_ASSERT(sVendor); OSL_ASSERT(sMinVersion); @@ -345,7 +345,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( OSL_ASSERT( ! (arExcludeList == NULL && nLenList > 0)); if (arExcludeList == NULL && nLenList > 0) return JFW_PLUGIN_E_INVALID_ARG; - + OUString ouVendor(sVendor); OUString ouMinVer(sMinVersion); OUString ouMaxVer(sMaxVersion); @@ -353,15 +353,15 @@ javaPluginError jfw_plugin_getJavaInfoByPath( OSL_ASSERT(ouVendor.getLength() > 0); if (ouVendor.getLength() == 0) return JFW_PLUGIN_E_INVALID_ARG; - + rtl::Reference<VendorBase> aVendorInfo = getJREInfoByPath(ouPath); if (aVendorInfo.is() == sal_False) return JFW_PLUGIN_E_NO_JRE; - + //Check if the detected JRE matches the version requirements if (ouVendor.equals(aVendorInfo->getVendor()) == sal_False) return JFW_PLUGIN_E_NO_JRE; - + if (ouMinVer.getLength() > 0) { int nRes = 0; @@ -381,7 +381,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( if (nRes < 0) return JFW_PLUGIN_E_FAILED_VERSION; } - + if (ouMaxVer.getLength() > 0) { int nRes = 0; @@ -401,7 +401,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( if (nRes > 0) return JFW_PLUGIN_E_FAILED_VERSION; } - + if (arExcludeList > 0) { for (int i = 0; i < nLenList; i++) @@ -438,7 +438,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath( */ extern "C" javaPluginError jfw_plugin_startJavaVirtualMachine( - const JavaInfo *pInfo, + const JavaInfo *pInfo, const JavaVMOption* arOptions, sal_Int32 cOptions, JavaVM ** ppVm, @@ -493,7 +493,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( typedef jint JNICALL JNI_CreateVM_Type(JavaVM **, JNIEnv **, void *); rtl::OUString sSymbolCreateJava( RTL_CONSTASCII_USTRINGPARAM("JNI_CreateJavaVM")); - + JNI_CreateVM_Type * pCreateJavaVM = (JNI_CreateVM_Type *) osl_getFunctionSymbol( moduleRt, sSymbolCreateJava.pData); if (!pCreateJavaVM) @@ -516,7 +516,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( boost::scoped_array<JavaVMOption> sarOptions( new JavaVMOption[cOptions + 1]); JavaVMOption * options = sarOptions.get(); - + // We set an abort handler which is called when the VM calls _exit during // JNI_CreateJavaVM. This happens when the LD_LIBRARY_PATH does not contain // all some directories of the Java installation. This is necessary for @@ -544,7 +544,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( } else { -#endif +#endif options[i+1].optionString = arOptions[i].optionString; options[i+1].extraInfo = arOptions[i].extraInfo; #ifdef UNX @@ -588,7 +588,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( // set err to a positive number, so as or recognize that an abort (longjmp) //occurred err= 1; - + if(err != 0) { rtl::OUString message; @@ -610,8 +610,8 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( *ppVm = pJavaVM; JFW_TRACE2("[Java framework] sunjavaplugin"SAL_DLLEXTENSION " has created a VM.\n"); } - - + + return errcode; } @@ -647,7 +647,7 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist) { rtl::OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData); JFW_TRACE2(OUSTR("[Java framework] Checking existence of Java runtime library.\n")); - + ::osl::DirectoryItem itemRt; ::osl::File::RC rc_itemRt = ::osl::DirectoryItem::get(sRuntimeLib, itemRt); if (::osl::File::E_None == rc_itemRt) diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map index 901867f0a43d..c08817d69cff 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map @@ -9,5 +9,5 @@ UDK_3_0_0 { UDK_3.1 { # OOo 3.3 global: - jfw_plugin_existJRE; + jfw_plugin_existJRE; } UDK_3_0_0; diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx index 81355dda210c..852c7cbfa638 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -85,14 +85,14 @@ char const* const* SunInfo::getRuntimePaths(int * size) char const* const* SunInfo::getLibraryPaths(int* size) { -#ifdef UNX +#ifdef UNX static char const * ar[] = { "/lib/" JFW_PLUGIN_ARCH "/client", #if defined(OPENBSD) "/lib/" JFW_PLUGIN_ARCH "/server", #endif - "/lib/" JFW_PLUGIN_ARCH "/native_threads", + "/lib/" JFW_PLUGIN_ARCH "/native_threads", "/lib/" JFW_PLUGIN_ARCH }; @@ -107,7 +107,7 @@ char const* const* SunInfo::getLibraryPaths(int* size) int SunInfo::compareVersions(const rtl::OUString& sSecond) const { OUString sFirst = getVersion(); - + SunVersion version1(sFirst); JFW_ENSURE(version1, OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION " does not know the version: ") diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx index 5851b16c8143..f862a616b535 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx index 53051c905d41..5f71afbd42b0 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,9 +50,9 @@ class SelfTest public: SelfTest(); } test; -#endif +#endif -SunVersion::SunVersion(const rtl::OUString &usVer): +SunVersion::SunVersion(const rtl::OUString &usVer): m_nUpdateSpecial(0), m_preRelease(Rel_NONE), usVersion(usVer) { @@ -60,7 +60,7 @@ SunVersion::SunVersion(const rtl::OUString &usVer): rtl::OString sVersion= rtl::OUStringToOString(usVer, osl_getThreadTextEncoding()); m_bValid = init(sVersion.getStr()); } -SunVersion::SunVersion(const char * szVer): +SunVersion::SunVersion(const char * szVer): m_nUpdateSpecial(0), m_preRelease(Rel_NONE) { memset(m_arVersionParts, 0, sizeof(m_arVersionParts)); @@ -75,7 +75,7 @@ bool SunVersion::init(const char *szVersion) { if ( ! szVersion || strlen(szVersion) == 0) return false; - + //first get the major,minor,maintainance const char * pLast = szVersion; const char * pCur = szVersion; @@ -110,26 +110,26 @@ bool SunVersion::init(const char *szVersion) pCur + 1 == pEnd ? isdigit(*(pCur)) : 1) ) { int len = pCur - pLast; - if (len >= 127) + if (len >= 127) return false; strncpy(buf, pLast, len); buf[len] = 0; - pCur ++; + pCur ++; pLast = pCur; - + m_arVersionParts[nPart] = atoi(buf); nPart ++; nPartPos = 0; if (nPart == 3) break; - + //check next character - if (! ( (pCur < pEnd) + if (! ( (pCur < pEnd) && ( (nPart < 3) && isdigit(*pCur)))) //(*pCur >= 48 && *pCur <=57)))) - return false; + return false; } - else + else { return false; } @@ -183,9 +183,9 @@ bool SunVersion::init(const char *szVersion) if (pCur < pEnd) pCur ++; else - break; + break; } - } + } } // 1.4.1-ea else if (*(pCur - 1) == '-') @@ -193,7 +193,7 @@ bool SunVersion::init(const char *szVersion) m_preRelease = getPreRelease(pCur); if (m_preRelease == Rel_NONE) return false; -#if defined(FREEBSD) +#if defined(FREEBSD) if (m_preRelease == Rel_FreeBSD) { pCur++; //elemnate `p' @@ -207,7 +207,7 @@ bool SunVersion::init(const char *szVersion) m_nUpdateSpecial = atoi(buf)+100; //hack for FBSD #i56953# return true; } -#endif +#endif } else { @@ -247,7 +247,7 @@ SunVersion::PreRelease SunVersion::getPreRelease(const char *szRelease) #if defined (FREEBSD) else if (! strncmp(szRelease, "p", 1)) return Rel_FreeBSD; -#endif +#endif else return Rel_NONE; } @@ -261,14 +261,14 @@ SunVersion::~SunVersion() a) 1.0 < 1.1 b) 1.0 < 1.0.0 c) 1.0 < 1.0_00 - + returns false if both values are equal */ bool SunVersion::operator > (const SunVersion& ver) const { if( &ver == this) return false; - + //compare major.minor.maintainance for( int i= 0; i < 4; i ++) { @@ -284,13 +284,13 @@ bool SunVersion::operator > (const SunVersion& ver) const } //major.minor.maintainance_update are equal. test for a trailing char if (m_nUpdateSpecial > ver.m_nUpdateSpecial) - { + { return true; } //Until here the versions are equal //compare pre -release values - if ((m_preRelease == Rel_NONE && ver.m_preRelease == Rel_NONE) + if ((m_preRelease == Rel_NONE && ver.m_preRelease == Rel_NONE) || (m_preRelease != Rel_NONE && ver.m_preRelease == Rel_NONE)) return false; @@ -298,12 +298,12 @@ bool SunVersion::operator > (const SunVersion& ver) const return true; else if (m_preRelease > ver.m_preRelease) return true; - + return false; } bool SunVersion::operator < (const SunVersion& ver) const -{ +{ return (! operator > (ver)) && (! operator == (ver)); } @@ -336,7 +336,7 @@ SelfTest::SelfTest() char const * versions[] = {"1.4.0", "1.4.1", "1.0.0", "10.0.0", "10.10.0", "10.2.2", "10.10.0", "10.10.10", "111.0.999", "1.4.1_01", "9.90.99_09", "1.4.1_99", - "1.4.1_00a", + "1.4.1_00a", "1.4.1-ea", "1.4.1-beta", "1.4.1-rc1", "1.5.0_01-ea", "1.5.0_01-rc2"}; char const * badVersions[] = {".4.0", "..1", "", "10.0", "10.10.0.", "10.10.0-", "10.10.0.", @@ -359,10 +359,10 @@ SelfTest::SelfTest() { bRet = false; break; - } + } } OSL_ENSURE(bRet, "SunVersion selftest failed"); - //Parsing test (negative) + //Parsing test (negative) for ( int i = 0; i < numBad; i++) { SunVersion ver(badVersions[i]); @@ -394,7 +394,7 @@ SelfTest::SelfTest() { bRet = false; break; - } + } } else if ( i == j) { diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx index 4e51f7a0a7a6..448100bbc327 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #include "rtl/ustring.hxx" -namespace jfw_plugin { +namespace jfw_plugin { // Define OSL_DEBUG_LEVEL >= 2 to run a test when this lib is loaded /* SunVersion is used to compare java versions based on a string, as taken @@ -46,7 +46,7 @@ namespace jfw_plugin { This class supports also a FreeBSD Java. This is currently necessary because it also has the vendor string "Sun Microsystems Inc.". - + An object acts as holder for the version string. That string may be present even if the version could not be parsed. Then the version may not be compatible to a SUN Java version. @@ -54,7 +54,7 @@ namespace jfw_plugin { An invalid object, that is, operator bool returns false, will always be the lower version in a comparison. If two invalid objects are compared then they are considered equal. - + To test if the version is ok, that is this object can be compared to others, use the bool conversion operator. */ @@ -104,7 +104,7 @@ public: /** Test if the version is compatible tu SUN's versioning scheme */ - operator bool (); + operator bool (); /** Will always contain a value if the object has been constructed with a version string. @@ -123,7 +123,7 @@ protected: PreRelease getPreRelease(const char *szRel); }; -} +} #endif // INCLUDED_JVMACCESS_SUNVERSION_HXX diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx index 75c1a96de7bf..3612169e6ed3 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -74,11 +74,11 @@ using namespace std; namespace { char const *g_arJavaNames[] = { "", - "j2re", - "j2se", + "j2re", + "j2se", "j2sdk", "jdk", - "jre", + "jre", "java", "Home", "IBMJava2-ppc-142" @@ -87,11 +87,11 @@ char const *g_arJavaNames[] = { */ char const *g_arCollectDirs[] = { "", - "j2re/", - "j2se/", + "j2re/", + "j2se/", "j2sdk/", "jdk/", - "jre/", + "jre/", "java/", "jvm/" }; @@ -133,7 +133,7 @@ namespace { rtl::OUString getLibraryLocation() { - rtl::OUString libraryFileUrl; + rtl::OUString libraryFileUrl; OSL_VERIFY(osl::Module::getUrlFromAddress((void *)(sal_IntPtr)getLibraryLocation, libraryFileUrl)); return getDirFromFile(libraryFileUrl); } @@ -144,7 +144,7 @@ namespace { static rtl::Bootstrap aInstance(sIni); return & aInstance; - + } }; @@ -289,7 +289,7 @@ class AsynchReader: public Thread { size_t m_nDataSize; boost::scoped_array<sal_Char> m_arData; - + bool m_bError; bool m_bDone; FileHandleGuard m_aGuard; @@ -302,7 +302,7 @@ public: /** only call this function after this thread has finished. That is, call join on this instance and then call getData. - + */ OString getData(); #endif @@ -335,12 +335,12 @@ void AsynchReader::run() case osl_File_E_PIPE: //HACK! for windows nRead = 0; case osl_File_E_None: - break; + break; default: m_bError = true; return; } - + if (nRead == 0) { m_bDone = true; @@ -390,7 +390,7 @@ bool getJavaProps(const OUString & exePath, //that it calls java.awt.Toolkit.getDefaultToolkit(); OUString sValue; getBootstrap()->getFrom(OUSTR("JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY"), sValue); - + //prepare the arguments sal_Int32 cArgs = 3; OUString arg1 = OUString(RTL_CONSTASCII_USTRINGPARAM("-classpath"));// + sClassPath; @@ -405,7 +405,7 @@ bool getJavaProps(const OUString & exePath, args[3] = arg4.pData; cArgs = 4; } - + oslProcess javaProcess= 0; oslFileHandle fileOut= 0; oslFileHandle fileErr= 0; @@ -477,7 +477,7 @@ bool getJavaProps(const OUString & exePath, stderrReader.join(); JFW_TRACE2(OString("[Java framework] Java wrote to stderr:\" ") + stderrReader.getData() + OString(" \".\n")); - + TimeValue waitMax= {5 ,0}; procErr = osl_joinProcessWithTimeout(javaProcess, &waitMax); OSL_ASSERT(procErr == osl_Process_E_None); @@ -544,7 +544,7 @@ void createJavaInfoFromWinReg(std::vector<rtl::Reference<VendorBase> > & vecInfo } -bool getJavaInfoFromRegistry(const wchar_t* szRegKey, +bool getJavaInfoFromRegistry(const wchar_t* szRegKey, vector<OUString>& vecJavaHome) { HKEY hRoot; @@ -554,8 +554,8 @@ bool getJavaInfoFromRegistry(const wchar_t* szRegKey, DWORD dwIndex = 0; const DWORD BUFFSIZE = 1024; wchar_t bufVersion[BUFFSIZE]; -// char bufVersion[BUFFSIZE]; - DWORD nNameLen = BUFFSIZE; +// char bufVersion[BUFFSIZE]; + DWORD nNameLen = BUFFSIZE; FILETIME fileTime; nNameLen = sizeof(bufVersion); @@ -648,7 +648,7 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec) // valid version //check if version of current is recognized, by comparing it with itself - try + try { cur->compareVersions(cur->getVersion()); } @@ -660,13 +660,13 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec) if (nCmp == 0) { try - { + { nCmp = cur->compareVersions(next->getVersion()); } catch (MalformedVersionException & ) { //The second version is invalid, therefor it is regardes less. - nCmp = 1; + nCmp = 1; } } if(nCmp == 1) // cur > next @@ -722,7 +722,7 @@ bool getJREInfoFromBinPath( // jre/bin/jre -> jre/bin OUString sMapPath(i->getStr(), index); index = sBinPath.lastIndexOf(sMapPath); - if (index != -1 + if (index != -1 && (index + sMapPath.getLength() == sBinPath.getLength()) && sBinPath[index - 1] == '/') { @@ -764,7 +764,7 @@ vector<Reference<VendorBase> > getAllJREInfos() return vecInfos; } - + vector<OUString> getVectorFromCharArray(char const * const * ar, int size) { vector<OUString> vec; @@ -779,7 +779,7 @@ bool getJREInfoByPath(const rtl::OUString& path, std::vector<rtl::Reference<VendorBase> > & vecInfos) { bool ret = false; - + rtl::Reference<VendorBase> aInfo = getJREInfoByPath(path); if (aInfo.is()) { @@ -814,7 +814,7 @@ OUString resolveDirPath(const OUString & path) FileStatus status(FileStatusMask_Type | FileStatusMask_LinkTargetURL | FileStatusMask_FileURL); - + if (item.getFileStatus(status) == File::E_None && status.getFileType() == FileStatus::Directory) { @@ -826,7 +826,7 @@ OUString resolveDirPath(const OUString & path) return ret; } /** Checks if the path is a file. If it is a link to a file than - it is resolved. + it is resolved. */ OUString resolveFilePath(const OUString & path) { @@ -848,11 +848,11 @@ OUString resolveFilePath(const OUString & path) && status.getFileType() == FileStatus::Regular) { ret = sResolved; - } + } } else return OUString(); - + return ret; } @@ -873,7 +873,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( // If this path is invalid then there is no chance to find a JRE here if (sResolvedDir.getLength() == 0) return 0; - + //check if the directory path is good, that is a JRE was already recognized. //Then we need not detect it again //For example, a sun JKD contains <jdk>/bin/java and <jdk>/jre/bin/java. @@ -884,7 +884,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( if (entry2 != mapJREs.end()) { JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION ": ") - + OUSTR("JRE found again (detected before): ") + sResolvedDir + + OUSTR("JRE found again (detected before): ") + sResolvedDir + OUSTR(".\n")); return entry2->second; } @@ -905,7 +905,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( { //if the path is a link, then resolve it //check if the executable exists at all - + //path can be only "file:///". Then do not append a '/' //sizeof counts the terminating 0 OUString sFullPath; @@ -917,7 +917,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( sFilePath = resolveFilePath(sFullPath); - + if (sFilePath.getLength() == 0) { //The file path (to java exe) is not valid @@ -935,7 +935,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( if (entry != mapJREs.end()) { JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION ": ") - + OUSTR("JRE found again (detected before): ") + sFilePath + + OUSTR("JRE found again (detected before): ") + sFilePath + OUSTR(".\n")); return entry->second; @@ -962,7 +962,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( //then it tries to start a jdk/.../native_threads/.java_wrapper. Therefore the link, which //is named java, must be used to start the script. getJavaProps(sFullPath, props, & bProcessRun); - // Either we found a working 1.3.1 + // Either we found a working 1.3.1 //Or the java is broken. In both cases we stop searchin under this "root" directory bBreak = true; break; @@ -988,12 +988,12 @@ rtl::Reference<VendorBase> getJREInfoByPath( if (props.size() == 0) return rtl::Reference<VendorBase>(); - + //find java.vendor property typedef vector<pair<OUString, OUString> >::const_iterator c_ip; OUString sVendor(RTL_CONSTASCII_USTRINGPARAM("java.vendor")); OUString sVendorName; - + for (c_ip i = props.begin(); i != props.end(); i++) { if (sVendor.equals(i->first)) @@ -1002,9 +1002,9 @@ rtl::Reference<VendorBase> getJREInfoByPath( break; } } - + if (sVendorName.getLength() > 0) - { + { //find the creator func for the respective vendor name for ( sal_Int32 c = 0; gVendorMap[c].sVendorName != NULL; ++c ) @@ -1017,17 +1017,17 @@ rtl::Reference<VendorBase> getJREInfoByPath( break; } } - } + } if (ret.is() == false) vecBadPaths.push_back(sFilePath); else { JFW_TRACE2(OUSTR("[Java framework] sunjavaplugin"SAL_DLLEXTENSION ": ") - + OUSTR("Found JRE: ") + sResolvedDir + + OUSTR("Found JRE: ") + sResolvedDir + OUSTR(" \n at: ") + path + OUSTR(".\n")); - + mapJREs.insert(MAPJRE::value_type(sResolvedDir, ret)); - mapJREs.insert(MAPJRE::value_type(sFilePath, ret)); + mapJREs.insert(MAPJRE::value_type(sFilePath, ret)); } return ret; @@ -1036,7 +1036,7 @@ rtl::Reference<VendorBase> getJREInfoByPath( Reference<VendorBase> createInstance(createInstance_func pFunc, vector<pair<OUString, OUString> > properties) { - + Reference<VendorBase> aBase = (*pFunc)(); if (aBase.is()) { @@ -1137,7 +1137,7 @@ bool makeDriveLetterSame(OUString * fileURL) void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) { JFW_TRACE2(OUSTR("\n[Java framework] Checking \"/usr/jdk/latest\"\n")); - getJREInfoByPath(OUSTR("file:////usr/jdk/latest"), vecInfos); + getJREInfoByPath(OUSTR("file:////usr/jdk/latest"), vecInfos); } #else @@ -1166,7 +1166,7 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) arCollectDirs[d] = OUString(g_arCollectDirs[d], strlen(g_arCollectDirs[d]), RTL_TEXTENCODING_UTF8); - + OUString usFile(RTL_CONSTASCII_USTRINGPARAM("file:///")); for( int ii = 0; ii < cSearchPaths; ii ++) @@ -1224,7 +1224,7 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) getJREInfoByPath(aStatus.getFileURL(),vecInfos); } - + JFW_ENSURE(errNext == File::E_None || errNext == File::E_NOENT, OUSTR("[Java framework] sunjavaplugin: " "Error while iterating over contens of ") @@ -1244,7 +1244,7 @@ void createJavaInfoDirScan(vector<rtl::Reference<VendorBase> >& vecInfos) { // /usr/java/j2re1.4.0 OUString usDir3(usDir2 + arNames[k]); - + DirectoryItem item3; if(DirectoryItem::get(usDir3, item) == File::E_None) { diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx index eedd51c16e33..ff54c00ce7c8 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,7 +65,7 @@ struct InfoFindSame { rtl::OUString sJava; InfoFindSame(const rtl::OUString& sJavaHome):sJava(sJavaHome){} - + bool operator () (const rtl::Reference<VendorBase> & aVendorInfo) { return aVendorInfo->getHome().equals(sJava) == sal_True ? true : false; diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx index fc11a040dce0..f3ca071b6baf 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -98,7 +98,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props) { //get java.vendor, java.version, java.home, //javax.accessibility.assistive_technologies from system properties - + OUString sVendor; typedef vector<pair<OUString, OUString> >::const_iterator it_prop; OUString sVendorProperty( @@ -114,7 +114,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props) bool bVendor = false; bool bHome = false; bool bAccess = false; - + typedef vector<pair<OUString, OUString> >::const_iterator it_prop; for (it_prop i = props.begin(); i != props.end(); i++) { @@ -158,15 +158,15 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props) } if (!bVersion || !bVendor || !bHome) return false; - + // init m_sRuntimeLibrary OSL_ASSERT(m_sHome.getLength()); //call virtual function to get the possible paths to the runtime library. - + int size = 0; char const* const* arRtPaths = getRuntimePaths( & size); vector<OUString> libpaths = getVectorFromCharArray(arRtPaths, size); - + bool bRt = false; typedef vector<OUString>::const_iterator i_path; for(i_path ip = libpaths.begin(); ip != libpaths.end(); ip++) @@ -215,7 +215,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props) } if (bLdPath == false) return false; - + return true; } @@ -272,7 +272,7 @@ int VendorBase::compareVersions(const rtl::OUString& /*sSecond*/) const } - + } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx index ae204e227ac0..997793f8c8e6 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -81,11 +81,11 @@ class MalformedVersionException { public: MalformedVersionException(); - + MalformedVersionException(const MalformedVersionException &); - + virtual ~MalformedVersionException(); - + MalformedVersionException & operator =(const MalformedVersionException &); }; @@ -103,7 +103,7 @@ public: The paths are relative file URLs. That is, they always contain '/' even on windows. The paths are relative to the installation directory of a JRE. - + The signature of this function must correspond to getJavaExePaths_func. @@ -149,7 +149,7 @@ public: if so, needsRestart returns true. */ virtual bool needsRestart() const; - + /* compares versions of this vendor. MUST be overridden in a derived class. #################################################### @@ -159,7 +159,7 @@ public: 0 this.version == sSecond 1 this.version > sSecond -1 this.version < sSEcond - + @throw MalformedVersionException if the version string was not recognized. */ diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx index 44bfeed7c9bc..2d976b3e8da5 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,7 +55,7 @@ BEGIN_VENDOR_MAP() VENDOR_MAP_ENTRY("BEA Systems, Inc.", OtherInfo) VENDOR_MAP_ENTRY("Free Software Foundation, Inc.", GnuInfo) VENDOR_MAP_ENTRY("The FreeBSD Foundation", OtherInfo) -END_VENDOR_MAP() +END_VENDOR_MAP() Sequence<OUString> getVendorNames() @@ -75,7 +75,7 @@ bool isVendorSupported(const rtl::OUString& sVendor) Sequence<OUString> seqNames = getVendorNames(); const OUString * arNames = seqNames.getConstArray(); sal_Int32 count = seqNames.getLength(); - + for (int i = 0; i < count; i++) { if (sVendor.equals(arNames[i])) @@ -85,7 +85,7 @@ bool isVendorSupported(const rtl::OUString& sVendor) OString sVendorName = OUStringToOString(sVendor, osl_getThreadTextEncoding()); fprintf(stderr, "[Java frameworksunjavaplugin.so]sunjavaplugin does not support vendor: %s.\n", sVendorName.getStr()); -#endif +#endif return false; } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx index f1987ef42961..dd021ad87779 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,7 +56,7 @@ struct VendorSupportMapEntry #define BEGIN_VENDOR_MAP() \ VendorSupportMapEntry gVendorMap[] ={ - + #define VENDOR_MAP_ENTRY(x,y) \ {x, & y::getJavaExePaths, & y::createInstance}, |