summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-04-13 12:16:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-04-13 17:32:43 +0200
commit2767dcc7b2dd4c82981ffdae74547223162c71ff (patch)
tree8b4463da2ebb1f69c24052728cd2c46f57985bcb /jvmfwk
parent41a20d3b3750fa6eeb8061af9dd25723d4698feb (diff)
Replace a use of CJavaInfo with std::unique_ptr<JavaInfo>
Change-Id: I89cb19969285200a61c47d29e819a50845fa692b
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/source/framework.cxx26
-rw-r--r--jvmfwk/source/framework.hxx1
2 files changed, 11 insertions, 16 deletions
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index b4e94e0d93bf..4786b9424844 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -540,14 +540,15 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
for (citLoc it = vecJRELocations.begin();
it != vecJRELocations.end(); ++it)
{
- jfw::CJavaInfo aInfo;
+ JavaInfo * info;
javaPluginError err = jfw_plugin_getJavaInfoByPath(
*it,
vendor,
versionInfo.sMinVersion,
versionInfo.sMaxVersion,
versionInfo.vecExcludeVersions,
- & aInfo.pInfo);
+ &info);
+ std::unique_ptr<JavaInfo> aInfo(info);
if (err == javaPluginError::NoJre)
continue;
if (err == javaPluginError::FailedVersion)
@@ -557,20 +558,23 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
if (aInfo)
{
- //We remember the very first installation in aCurrentInfo
- if (aCurrentInfo.getLocation().isEmpty())
- aCurrentInfo = aInfo;
// compare features
// If the user does not require any features (nFeatureFlags = 0)
// then the first installation is used
- if ((aInfo.getFeatures() & nFeatureFlags) == nFeatureFlags)
+ if ((aInfo->nFeatures & nFeatureFlags) == nFeatureFlags)
{
//the just found Java implements all required features
//currently there is only accessibility!!!
- aCurrentInfo = aInfo;
+ aCurrentInfo = aInfo.release();
bInfoFound = true;
break;
}
+ else if (aCurrentInfo.getLocation().isEmpty())
+ {
+ // We remember the very first installation in
+ // aCurrentInfo:
+ aCurrentInfo = aInfo.release();
+ }
}
}//end iterate over paths
if (bInfoFound)
@@ -1040,14 +1044,6 @@ OUString CJavaInfo::getLocation() const
return OUString();
}
-sal_uInt64 CJavaInfo::getFeatures() const
-{
- if (pInfo)
- return pInfo->nFeatures;
- else
- return 0l;
-}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/jvmfwk/source/framework.hxx b/jvmfwk/source/framework.hxx
index f514964db995..04fdf86165bf 100644
--- a/jvmfwk/source/framework.hxx
+++ b/jvmfwk/source/framework.hxx
@@ -58,7 +58,6 @@ public:
operator ::JavaInfo* () { return pInfo;}
OUString getLocation() const;
- sal_uInt64 getFeatures() const;
static JavaInfo * copyJavaInfo(const JavaInfo * pInfo);
};