Kaydet (Commit) 772a3693 authored tarafından Michael Weghorn's avatar Michael Weghorn Kaydeden (comit) Stephan Bergmann

changed type of parameters from rtl_uString to OUString

changed type of several parameters of the functions
jfw_plugin_getAllJavaInfos and jfw_plugin_getJavaInfoByPath
from rtl_uString to OUString

Change-Id: I80feb311542e6ccded9f9924f800c75a7e14a1e7
Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 3c95503c
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
what version a JRE must have then it relies on certain features and bug what version a JRE must have then it relies on certain features and bug
fixes of that version. Because a version 1.4.2_1 from vendor X may contain fixes of that version. Because a version 1.4.2_1 from vendor X may contain
different fixes as the same version from vendor Y it is important to see different fixes as the same version from vendor Y it is important to see
version an vendor as one entity. One without the other does not guarantee version and vendor as one entity. One without the other does not guarantee
the existence of a particular set of features or bug fixes. An implementation the existence of a particular set of features or bug fixes. An implementation
of this API may support multiple vendors. </p> of this API may support multiple vendors. </p>
<p> <p>
...@@ -83,11 +83,9 @@ typedef enum ...@@ -83,11 +83,9 @@ typedef enum
[in] only JREs from this vendor are examined. This parameter always contains [in] only JREs from this vendor are examined. This parameter always contains
a vendor string. That is, the string it is not empty. a vendor string. That is, the string it is not empty.
@param sMinVersion @param sMinVersion
[in] represents the minimum version of a JRE. The string can be empty but [in] represents the minimum version of a JRE. The string can be empty.
a null pointer is not allowed.
@param sMaxVersion @param sMaxVersion
[in] represents the maximum version of a JRE. The string can be empty but [in] represents the maximum version of a JRE. The string can be empty.
a null pointer is not allowed.
@param arExcludeList @param arExcludeList
[in] contains a list of &quot;bad&quot; versions. JREs which have one of these [in] contains a list of &quot;bad&quot; versions. JREs which have one of these
versions must not be returned by this function. It can be NULL. versions must not be returned by this function. It can be NULL.
...@@ -111,9 +109,9 @@ typedef enum ...@@ -111,9 +109,9 @@ typedef enum
version strings. version strings.
*/ */
javaPluginError jfw_plugin_getAllJavaInfos( javaPluginError jfw_plugin_getAllJavaInfos(
rtl_uString *sVendor, OUString const& sVendor,
rtl_uString *sMinVersion, OUString const& sMinVersion,
rtl_uString *sMaxVersion, OUString const& sMaxVersion,
rtl_uString * * arExcludeList, rtl_uString * * arExcludeList,
sal_Int32 nSizeExcludeList, sal_Int32 nSizeExcludeList,
JavaInfo*** parJavaInfo, JavaInfo*** parJavaInfo,
...@@ -162,10 +160,10 @@ javaPluginError jfw_plugin_getAllJavaInfos( ...@@ -162,10 +160,10 @@ javaPluginError jfw_plugin_getAllJavaInfos(
a vendor which is not supported by this API implementation. a vendor which is not supported by this API implementation.
*/ */
javaPluginError jfw_plugin_getJavaInfoByPath( javaPluginError jfw_plugin_getJavaInfoByPath(
rtl_uString *sLocation, OUString const& sLocation,
rtl_uString *sVendor, OUString const& sVendor,
rtl_uString *sMinVersion, OUString const& sMinVersion,
rtl_uString *sMaxVersion, OUString const& sMaxVersion,
rtl_uString * *arExcludeList, rtl_uString * *arExcludeList,
sal_Int32 nSizeExcludeList, sal_Int32 nSizeExcludeList,
JavaInfo ** ppInfo); JavaInfo ** ppInfo);
......
...@@ -210,11 +210,9 @@ extern "C" void JNICALL abort_handler() ...@@ -210,11 +210,9 @@ extern "C" void JNICALL abort_handler()
@param aVendorInfo @param aVendorInfo
[in] the object to be inspected whether it meets the version requirements [in] the object to be inspected whether it meets the version requirements
@param sMinVersion @param sMinVersion
[in] represents the minimum version of a JRE. The string can be empty but [in] represents the minimum version of a JRE. The string can be empty.
a null pointer is not allowed.
@param sMaxVersion @param sMaxVersion
[in] represents the maximum version of a JRE. The string can be empty but [in] represents the maximum version of a JRE. The string can be empty.
a null pointer is not allowed.
@param arExcludeList @param arExcludeList
[in] contains a list of &quot;bad&quot; versions. JREs which have one of these [in] contains a list of &quot;bad&quot; versions. JREs which have one of these
versions must not be returned by this function. It can be NULL. versions must not be returned by this function. It can be NULL.
...@@ -232,19 +230,16 @@ extern "C" void JNICALL abort_handler() ...@@ -232,19 +230,16 @@ extern "C" void JNICALL abort_handler()
*/ */
javaPluginError checkJavaVersionRequirements( javaPluginError checkJavaVersionRequirements(
rtl::Reference<VendorBase> const & aVendorInfo, rtl::Reference<VendorBase> const & aVendorInfo,
rtl_uString *sMinVersion, OUString const& sMinVersion,
rtl_uString *sMaxVersion, OUString const& sMaxVersion,
rtl_uString * * arExcludeList, rtl_uString * * arExcludeList,
sal_Int32 nLenList) sal_Int32 nLenList)
{ {
OUString ouMinVer(sMinVersion); if (!sMinVersion.isEmpty())
OUString ouMaxVer(sMaxVersion);
if (!ouMinVer.isEmpty())
{ {
try try
{ {
if (aVendorInfo->compareVersions(ouMinVer) < 0) if (aVendorInfo->compareVersions(sMinVersion) < 0)
return JFW_PLUGIN_E_FAILED_VERSION; return JFW_PLUGIN_E_FAILED_VERSION;
} }
catch (MalformedVersionException&) catch (MalformedVersionException&)
...@@ -253,17 +248,17 @@ javaPluginError checkJavaVersionRequirements( ...@@ -253,17 +248,17 @@ javaPluginError checkJavaVersionRequirements(
JFW_ENSURE( JFW_ENSURE(
false, false,
"[Java framework]sunjavaplugin does not know version: " "[Java framework]sunjavaplugin does not know version: "
+ ouMinVer + " for vendor: " + aVendorInfo->getVendor() + sMinVersion + " for vendor: " + aVendorInfo->getVendor()
+ " .Check minimum Version." ); + " .Check minimum Version." );
return JFW_PLUGIN_E_WRONG_VERSION_FORMAT; return JFW_PLUGIN_E_WRONG_VERSION_FORMAT;
} }
} }
if (!ouMaxVer.isEmpty()) if (!sMaxVersion.isEmpty())
{ {
try try
{ {
if (aVendorInfo->compareVersions(ouMaxVer) > 0) if (aVendorInfo->compareVersions(sMaxVersion) > 0)
return JFW_PLUGIN_E_FAILED_VERSION; return JFW_PLUGIN_E_FAILED_VERSION;
} }
catch (MalformedVersionException&) catch (MalformedVersionException&)
...@@ -272,7 +267,7 @@ javaPluginError checkJavaVersionRequirements( ...@@ -272,7 +267,7 @@ javaPluginError checkJavaVersionRequirements(
JFW_ENSURE( JFW_ENSURE(
false, false,
"[Java framework]sunjavaplugin does not know version: " "[Java framework]sunjavaplugin does not know version: "
+ ouMaxVer + " for vendor: " + aVendorInfo->getVendor() + sMaxVersion + " for vendor: " + aVendorInfo->getVendor()
+ " .Check maximum Version." ); + " .Check maximum Version." );
return JFW_PLUGIN_E_WRONG_VERSION_FORMAT; return JFW_PLUGIN_E_WRONG_VERSION_FORMAT;
} }
...@@ -304,20 +299,17 @@ javaPluginError checkJavaVersionRequirements( ...@@ -304,20 +299,17 @@ javaPluginError checkJavaVersionRequirements(
} }
javaPluginError jfw_plugin_getAllJavaInfos( javaPluginError jfw_plugin_getAllJavaInfos(
rtl_uString *sVendor, OUString const& sVendor,
rtl_uString *sMinVersion, OUString const& sMinVersion,
rtl_uString *sMaxVersion, OUString const& sMaxVersion,
rtl_uString * *arExcludeList, rtl_uString * *arExcludeList,
sal_Int32 nLenList, sal_Int32 nLenList,
JavaInfo*** parJavaInfo, JavaInfo*** parJavaInfo,
sal_Int32 *nLenInfoList) sal_Int32 *nLenInfoList)
{ {
OSL_ASSERT(sVendor);
OSL_ASSERT(sMinVersion);
OSL_ASSERT(sMaxVersion);
OSL_ASSERT(parJavaInfo); OSL_ASSERT(parJavaInfo);
OSL_ASSERT(nLenInfoList); OSL_ASSERT(nLenInfoList);
if (!sVendor || !sMinVersion || !sMaxVersion || !parJavaInfo || !nLenInfoList) if (!parJavaInfo || !nLenInfoList)
return JFW_PLUGIN_E_INVALID_ARG; return JFW_PLUGIN_E_INVALID_ARG;
//nLenlist contains the number of elements in arExcludeList. //nLenlist contains the number of elements in arExcludeList.
...@@ -326,10 +318,8 @@ javaPluginError jfw_plugin_getAllJavaInfos( ...@@ -326,10 +318,8 @@ javaPluginError jfw_plugin_getAllJavaInfos(
if (arExcludeList == NULL && nLenList > 0) if (arExcludeList == NULL && nLenList > 0)
return JFW_PLUGIN_E_INVALID_ARG; return JFW_PLUGIN_E_INVALID_ARG;
OUString ouVendor(sVendor); OSL_ASSERT(!sVendor.isEmpty());
if (sVendor.isEmpty())
OSL_ASSERT(!ouVendor.isEmpty());
if (ouVendor.isEmpty())
return JFW_PLUGIN_E_INVALID_ARG; return JFW_PLUGIN_E_INVALID_ARG;
JavaInfo** arInfo = NULL; JavaInfo** arInfo = NULL;
...@@ -344,7 +334,7 @@ javaPluginError jfw_plugin_getAllJavaInfos( ...@@ -344,7 +334,7 @@ javaPluginError jfw_plugin_getAllJavaInfos(
{ {
const rtl::Reference<VendorBase>& cur = *i; const rtl::Reference<VendorBase>& cur = *i;
if (!ouVendor.equals(cur->getVendor())) if (!sVendor.equals(cur->getVendor()))
continue; continue;
javaPluginError err = checkJavaVersionRequirements( javaPluginError err = checkJavaVersionRequirements(
...@@ -374,23 +364,18 @@ javaPluginError jfw_plugin_getAllJavaInfos( ...@@ -374,23 +364,18 @@ javaPluginError jfw_plugin_getAllJavaInfos(
} }
javaPluginError jfw_plugin_getJavaInfoByPath( javaPluginError jfw_plugin_getJavaInfoByPath(
rtl_uString *path, OUString const& sPath,
rtl_uString *sVendor, OUString const& sVendor,
rtl_uString *sMinVersion, OUString const& sMinVersion,
rtl_uString *sMaxVersion, OUString const& sMaxVersion,
rtl_uString * *arExcludeList, rtl_uString * *arExcludeList,
sal_Int32 nLenList, sal_Int32 nLenList,
JavaInfo ** ppInfo) JavaInfo ** ppInfo)
{ {
OSL_ASSERT(path); if (!ppInfo)
OSL_ASSERT(sVendor);
OSL_ASSERT(sMinVersion);
OSL_ASSERT(sMaxVersion);
if (!path || !sVendor || !sMinVersion || !sMaxVersion || !ppInfo)
return JFW_PLUGIN_E_INVALID_ARG; return JFW_PLUGIN_E_INVALID_ARG;
OUString ouPath(path); OSL_ASSERT(!sPath.isEmpty());
OSL_ASSERT(!ouPath.isEmpty()); if (sPath.isEmpty())
if (ouPath.isEmpty())
return JFW_PLUGIN_E_INVALID_ARG; return JFW_PLUGIN_E_INVALID_ARG;
//nLenlist contains the number of elements in arExcludeList. //nLenlist contains the number of elements in arExcludeList.
...@@ -399,18 +384,16 @@ javaPluginError jfw_plugin_getJavaInfoByPath( ...@@ -399,18 +384,16 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
if (arExcludeList == NULL && nLenList > 0) if (arExcludeList == NULL && nLenList > 0)
return JFW_PLUGIN_E_INVALID_ARG; return JFW_PLUGIN_E_INVALID_ARG;
OUString ouVendor(sVendor); OSL_ASSERT(!sVendor.isEmpty());
if (sVendor.isEmpty())
OSL_ASSERT(!ouVendor.isEmpty());
if (ouVendor.isEmpty())
return JFW_PLUGIN_E_INVALID_ARG; return JFW_PLUGIN_E_INVALID_ARG;
rtl::Reference<VendorBase> aVendorInfo = getJREInfoByPath(ouPath); rtl::Reference<VendorBase> aVendorInfo = getJREInfoByPath(sPath);
if (!aVendorInfo.is()) if (!aVendorInfo.is())
return JFW_PLUGIN_E_NO_JRE; return JFW_PLUGIN_E_NO_JRE;
//Check if the detected JRE matches the version requirements //Check if the detected JRE matches the version requirements
if (!ouVendor.equals(aVendorInfo->getVendor())) if (!sVendor.equals(aVendorInfo->getVendor()))
return JFW_PLUGIN_E_NO_JRE; return JFW_PLUGIN_E_NO_JRE;
javaPluginError errorcode = checkJavaVersionRequirements( javaPluginError errorcode = checkJavaVersionRequirements(
aVendorInfo, sMinVersion, sMaxVersion, arExcludeList, nLenList); aVendorInfo, sMinVersion, sMaxVersion, arExcludeList, nLenList);
......
...@@ -88,9 +88,9 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi ...@@ -88,9 +88,9 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi
sal_Int32 cInfos = 0; sal_Int32 cInfos = 0;
JavaInfo** arInfos = NULL; JavaInfo** arInfos = NULL;
javaPluginError plerr = jfw_plugin_getAllJavaInfos( javaPluginError plerr = jfw_plugin_getAllJavaInfos(
vendor.pData, vendor,
versionInfo.sMinVersion.pData, versionInfo.sMinVersion,
versionInfo.sMaxVersion.pData, versionInfo.sMaxVersion,
versionInfo.getExcludeVersions(), versionInfo.getExcludeVersions(),
versionInfo.getExcludeVersionSize(), versionInfo.getExcludeVersionSize(),
& arInfos, & arInfos,
...@@ -114,10 +114,10 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi ...@@ -114,10 +114,10 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi
{ {
jfw::CJavaInfo aInfo; jfw::CJavaInfo aInfo;
plerr = jfw_plugin_getJavaInfoByPath( plerr = jfw_plugin_getJavaInfoByPath(
ii->pData, *ii,
vendor.pData, vendor,
versionInfo.sMinVersion.pData, versionInfo.sMinVersion,
versionInfo.sMaxVersion.pData, versionInfo.sMaxVersion,
versionInfo.getExcludeVersions(), versionInfo.getExcludeVersions(),
versionInfo.getExcludeVersionSize(), versionInfo.getExcludeVersionSize(),
& aInfo.pInfo); & aInfo.pInfo);
...@@ -405,9 +405,9 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) ...@@ -405,9 +405,9 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
sal_Int32 cInfos = 0; sal_Int32 cInfos = 0;
JavaInfo** arInfos = NULL; JavaInfo** arInfos = NULL;
javaPluginError plerr = jfw_plugin_getAllJavaInfos( javaPluginError plerr = jfw_plugin_getAllJavaInfos(
vendor.pData, vendor,
versionInfo.sMinVersion.pData, versionInfo.sMinVersion,
versionInfo.sMaxVersion.pData, versionInfo.sMaxVersion,
versionInfo.getExcludeVersions(), versionInfo.getExcludeVersions(),
versionInfo.getExcludeVersionSize(), versionInfo.getExcludeVersionSize(),
& arInfos, & arInfos,
...@@ -475,10 +475,10 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) ...@@ -475,10 +475,10 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
{ {
jfw::CJavaInfo aInfo; jfw::CJavaInfo aInfo;
javaPluginError err = jfw_plugin_getJavaInfoByPath( javaPluginError err = jfw_plugin_getJavaInfoByPath(
it->pData, *it,
vendor.pData, vendor,
versionInfo.sMinVersion.pData, versionInfo.sMinVersion,
versionInfo.sMaxVersion.pData, versionInfo.sMaxVersion,
versionInfo.getExcludeVersions(), versionInfo.getExcludeVersions(),
versionInfo.getExcludeVersionSize(), versionInfo.getExcludeVersionSize(),
& aInfo.pInfo); & aInfo.pInfo);
...@@ -651,6 +651,8 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( ...@@ -651,6 +651,8 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
if (pPath == NULL || ppInfo == NULL) if (pPath == NULL || ppInfo == NULL)
return JFW_E_INVALID_ARG; return JFW_E_INVALID_ARG;
OUString ouPath(pPath);
jfw::VendorSettings aVendorSettings; jfw::VendorSettings aVendorSettings;
std::vector<OUString> vecVendors = std::vector<OUString> vecVendors =
aVendorSettings.getSupportedVendors(); aVendorSettings.getSupportedVendors();
...@@ -671,10 +673,10 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( ...@@ -671,10 +673,10 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
//Only if it does return a JavaInfo //Only if it does return a JavaInfo
JavaInfo* pInfo = NULL; JavaInfo* pInfo = NULL;
javaPluginError plerr = jfw_plugin_getJavaInfoByPath( javaPluginError plerr = jfw_plugin_getJavaInfoByPath(
pPath, ouPath,
vendor.pData, vendor,
versionInfo.sMinVersion.pData, versionInfo.sMinVersion,
versionInfo.sMaxVersion.pData, versionInfo.sMaxVersion,
versionInfo.getExcludeVersions(), versionInfo.getExcludeVersions(),
versionInfo.getExcludeVersionSize(), versionInfo.getExcludeVersionSize(),
& pInfo); & pInfo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment