Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
f2761718
Kaydet (Commit)
f2761718
authored
Nis 13, 2017
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use std::unique_ptr<JavaInfo> in jfw_plugin_getAllJavaInfos
Change-Id: I2beb95c42c666a788a87a45f59bc15ccfcf25aa6
üst
8d475bb1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
62 deletions
+13
-62
vendorplugin.hxx
jvmfwk/inc/vendorplugin.hxx
+2
-13
sunjavaplugin.cxx
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+4
-12
framework.cxx
jvmfwk/source/framework.cxx
+7
-32
framework.hxx
jvmfwk/source/framework.hxx
+0
-5
No files found.
jvmfwk/inc/vendorplugin.hxx
Dosyayı görüntüle @
f2761718
...
...
@@ -74,13 +74,6 @@ enum class javaPluginError
The JavaInfo structures returned in <code>parJavaInfo</code> should be ordered
according to their version. The one, representing a JRE with the highest
version should be the first in the array. </p>
<p>
The function allocates memory for an array and all the JavaInfo objects returned
in <code>parJavaInfo</code>. The caller must delete each JavaInfo object.
The array is to be
freed by rtl_freeMemory.
In case an error occurred <code>parJavaInfo</code> need not be freed.
</p>
@param sVendor
[in] only JREs from this vendor are examined. This parameter always contains
a vendor string. That is, the string it is not empty.
...
...
@@ -93,10 +86,7 @@ enum class javaPluginError
versions must not be returned by this function.
@param parJavaInfo
[out] if the function runs successfully then <code>parJavaInfo</code> contains
on return an array of pointers to <code>JavaInfo</code> objects.
@param nSizeJavaInfo
[out] the number of <code>JavaInfo</code> pointers contained in
<code>parJavaInfo</code>.
on return a vector of pointers to <code>JavaInfo</code> objects.
@return
javaPluginError::NONE the function ran successfully.</br>
...
...
@@ -112,8 +102,7 @@ javaPluginError jfw_plugin_getAllJavaInfos(
OUString
const
&
sMinVersion
,
OUString
const
&
sMaxVersion
,
std
::
vector
<
OUString
>
const
&
arExcludeList
,
JavaInfo
***
parJavaInfo
,
sal_Int32
*
nSizeJavaInfo
,
std
::
vector
<
std
::
unique_ptr
<
JavaInfo
>>
*
parJavaInfo
,
std
::
vector
<
rtl
::
Reference
<
jfw_plugin
::
VendorBase
>>
&
infos
);
/** obtains information for a JRE at a given location.
...
...
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
Dosyayı görüntüle @
f2761718
...
...
@@ -299,19 +299,15 @@ javaPluginError jfw_plugin_getAllJavaInfos(
OUString
const
&
sMinVersion
,
OUString
const
&
sMaxVersion
,
std
::
vector
<
OUString
>
const
&
arExcludeList
,
JavaInfo
***
parJavaInfo
,
sal_Int32
*
nLenInfoList
,
std
::
vector
<
std
::
unique_ptr
<
JavaInfo
>>*
parJavaInfo
,
std
::
vector
<
rtl
::
Reference
<
jfw_plugin
::
VendorBase
>>
&
infos
)
{
assert
(
parJavaInfo
);
assert
(
nLenInfoList
);
OSL_ASSERT
(
!
sVendor
.
isEmpty
());
if
(
sVendor
.
isEmpty
())
return
javaPluginError
::
InvalidArg
;
JavaInfo
**
arInfo
=
nullptr
;
//Find all JREs
vector
<
rtl
::
Reference
<
VendorBase
>
>
vecInfos
=
addAllJREInfos
(
checkJavaHomeAndPath
,
infos
);
...
...
@@ -337,17 +333,13 @@ javaPluginError jfw_plugin_getAllJavaInfos(
}
//Now vecVerifiedInfos contains all those JREs which meet the version requirements
//Transfer them into the array that is passed out.
arInfo
=
static_cast
<
JavaInfo
**>
(
rtl_allocateMemory
(
vecVerifiedInfos
.
size
()
*
sizeof
(
JavaInfo
*
)));
int
j
=
0
;
parJavaInfo
->
clear
();
typedef
vector
<
rtl
::
Reference
<
VendorBase
>
>::
const_iterator
cit
;
for
(
cit
ii
=
vecVerifiedInfos
.
begin
();
ii
!=
vecVerifiedInfos
.
end
();
++
ii
,
++
j
)
for
(
cit
ii
=
vecVerifiedInfos
.
begin
();
ii
!=
vecVerifiedInfos
.
end
();
++
ii
)
{
arInfo
[
j
]
=
createJavaInfo
(
*
ii
);
parJavaInfo
->
push_back
(
std
::
unique_ptr
<
JavaInfo
>
(
createJavaInfo
(
*
ii
))
);
}
*
nLenInfoList
=
vecVerifiedInfos
.
size
();
*
parJavaInfo
=
arInfo
;
return
javaPluginError
::
NONE
;
}
...
...
jvmfwk/source/framework.cxx
Dosyayı görüntüle @
f2761718
...
...
@@ -75,8 +75,7 @@ javaFrameworkError jfw_findAllJREs(std::vector<std::unique_ptr<JavaInfo>> *pparI
//get all installations of one vendor according to minVersion,
//maxVersion and excludeVersions
sal_Int32
cInfos
=
0
;
JavaInfo
**
arInfos
=
nullptr
;
std
::
vector
<
std
::
unique_ptr
<
JavaInfo
>>
arInfos
;
std
::
vector
<
rtl
::
Reference
<
jfw_plugin
::
VendorBase
>>
infos
;
javaPluginError
plerr
=
jfw_plugin_getAllJavaInfos
(
true
,
...
...
@@ -85,16 +84,13 @@ javaFrameworkError jfw_findAllJREs(std::vector<std::unique_ptr<JavaInfo>> *pparI
versionInfo
.
sMaxVersion
,
versionInfo
.
vecExcludeVersions
,
&
arInfos
,
&
cInfos
,
infos
);
if
(
plerr
!=
javaPluginError
::
NONE
)
return
JFW_E_ERROR
;
for
(
int
j
=
0
;
j
<
cInfos
;
j
++
)
vecInfo
.
push_back
(
std
::
unique_ptr
<
JavaInfo
>
(
arInfos
[
j
]));
rtl_freeMemory
(
arInfos
);
for
(
auto
&
j
:
arInfos
)
vecInfo
.
push_back
(
std
::
move
(
j
));
//Check if the current plugin can detect JREs at the location
// of the paths added by jfw_addJRELocation
...
...
@@ -423,8 +419,7 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
//get all installations of one vendor according to minVersion,
//maxVersion and excludeVersions
sal_Int32
cInfos
=
0
;
JavaInfo
**
arInfos
=
nullptr
;
std
::
vector
<
std
::
unique_ptr
<
JavaInfo
>>
arInfos
;
javaPluginError
plerr
=
jfw_plugin_getAllJavaInfos
(
false
,
vendor
,
...
...
@@ -432,22 +427,14 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
versionInfo
.
sMaxVersion
,
versionInfo
.
vecExcludeVersions
,
&
arInfos
,
&
cInfos
,
infos
);
if
(
plerr
!=
javaPluginError
::
NONE
)
continue
;
//iterate over all installations to find the best which has
//all features
if
(
cInfos
==
0
)
for
(
auto
&
pJInfo
:
arInfos
)
{
rtl_freeMemory
(
arInfos
);
continue
;
}
for
(
int
ii
=
0
;
ii
<
cInfos
;
ii
++
)
{
JavaInfo
*
pJInfo
=
arInfos
[
ii
];
// compare features
// If the user does not require any features (nFeatureFlags = 0)
// then the first installation is used
...
...
@@ -455,8 +442,7 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
{
//the just found Java implements all required features
//currently there is only accessibility!!!
aCurrentInfo
.
reset
(
jfw
::
CJavaInfo
::
copyJavaInfo
(
pJInfo
));
aCurrentInfo
=
std
::
move
(
pJInfo
);
bInfoFound
=
true
;
break
;
}
...
...
@@ -464,15 +450,9 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
{
// We remember the first installation in aCurrentInfo if
// no JavaInfo has been found before:
aCurrentInfo
.
reset
(
jfw
::
CJavaInfo
::
copyJavaInfo
(
pJInfo
));
aCurrentInfo
=
std
::
move
(
pJInfo
);
}
}
//The array returned by jfw_plugin_getAllJavaInfos must be freed as well as
//its contents
for
(
int
j
=
0
;
j
<
cInfos
;
j
++
)
delete
arInfos
[
j
];
rtl_freeMemory
(
arInfos
);
if
(
bInfoFound
)
break
;
...
...
@@ -928,9 +908,4 @@ void jfw_unlock()
jfw
::
FwkMutex
::
get
().
release
();
}
JavaInfo
*
jfw
::
CJavaInfo
::
copyJavaInfo
(
const
JavaInfo
*
pInfo
)
{
return
pInfo
==
nullptr
?
nullptr
:
new
JavaInfo
(
*
pInfo
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
jvmfwk/source/framework.hxx
Dosyayı görüntüle @
f2761718
...
...
@@ -27,11 +27,6 @@
namespace
jfw
{
namespace
CJavaInfo
{
JavaInfo
*
copyJavaInfo
(
const
JavaInfo
*
pInfo
);
}
class
FrameworkException
:
public
std
::
exception
{
public
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment