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
81da71b6
Kaydet (Commit)
81da71b6
authored
Kas 10, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:nullptr (automatic rewrite)
Change-Id: I226aeb4787a4c30e17fb54dc7775a288aa09b760
üst
6794c2e4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
classpath.cxx
jvmaccess/source/classpath.cxx
+12
-12
unovirtualmachine.cxx
jvmaccess/source/unovirtualmachine.cxx
+2
-2
virtualmachine.cxx
jvmaccess/source/virtualmachine.cxx
+6
-6
No files found.
jvmaccess/source/classpath.cxx
Dosyayı görüntüle @
81da71b6
...
@@ -43,15 +43,15 @@ jobjectArray jvmaccess::ClassPath::translateToUrls(
...
@@ -43,15 +43,15 @@ jobjectArray jvmaccess::ClassPath::translateToUrls(
JNIEnv
*
environment
,
OUString
const
&
classPath
)
JNIEnv
*
environment
,
OUString
const
&
classPath
)
{
{
assert
(
context
.
is
());
assert
(
context
.
is
());
assert
(
environment
!=
0
);
assert
(
environment
!=
nullptr
);
jclass
classUrl
(
environment
->
FindClass
(
"java/net/URL"
));
jclass
classUrl
(
environment
->
FindClass
(
"java/net/URL"
));
if
(
classUrl
==
0
)
{
if
(
classUrl
==
nullptr
)
{
return
0
;
return
nullptr
;
}
}
jmethodID
ctorUrl
(
jmethodID
ctorUrl
(
environment
->
GetMethodID
(
classUrl
,
"<init>"
,
"(Ljava/lang/String;)V"
));
environment
->
GetMethodID
(
classUrl
,
"<init>"
,
"(Ljava/lang/String;)V"
));
if
(
ctorUrl
==
0
)
{
if
(
ctorUrl
==
nullptr
)
{
return
0
;
return
nullptr
;
}
}
::
std
::
vector
<
jobject
>
urls
;
::
std
::
vector
<
jobject
>
urls
;
for
(
::
sal_Int32
i
=
0
;
i
!=
-
1
;)
{
for
(
::
sal_Int32
i
=
0
;
i
!=
-
1
;)
{
...
@@ -76,22 +76,22 @@ jobjectArray jvmaccess::ClassPath::translateToUrls(
...
@@ -76,22 +76,22 @@ jobjectArray jvmaccess::ClassPath::translateToUrls(
arg
.
l
=
environment
->
NewString
(
arg
.
l
=
environment
->
NewString
(
static_cast
<
jchar
const
*
>
(
url
.
getStr
()),
static_cast
<
jchar
const
*
>
(
url
.
getStr
()),
static_cast
<
jsize
>
(
url
.
getLength
()));
static_cast
<
jsize
>
(
url
.
getLength
()));
if
(
arg
.
l
==
0
)
{
if
(
arg
.
l
==
nullptr
)
{
return
0
;
return
nullptr
;
}
}
jobject
o
(
environment
->
NewObjectA
(
classUrl
,
ctorUrl
,
&
arg
));
jobject
o
(
environment
->
NewObjectA
(
classUrl
,
ctorUrl
,
&
arg
));
if
(
o
==
0
)
{
if
(
o
==
nullptr
)
{
return
0
;
return
nullptr
;
}
}
urls
.
push_back
(
o
);
urls
.
push_back
(
o
);
}
}
}
}
jobjectArray
result
=
environment
->
NewObjectArray
(
jobjectArray
result
=
environment
->
NewObjectArray
(
static_cast
<
jsize
>
(
urls
.
size
()),
classUrl
,
0
);
static_cast
<
jsize
>
(
urls
.
size
()),
classUrl
,
nullptr
);
// static_cast is ok, as each element of urls occupied at least one
// static_cast is ok, as each element of urls occupied at least one
// character of the OUString classPath
// character of the OUString classPath
if
(
result
==
0
)
{
if
(
result
==
nullptr
)
{
return
0
;
return
nullptr
;
}
}
jsize
idx
=
0
;
jsize
idx
=
0
;
for
(
std
::
vector
<
jobject
>::
iterator
i
(
urls
.
begin
());
i
!=
urls
.
end
();
++
i
)
for
(
std
::
vector
<
jobject
>::
iterator
i
(
urls
.
begin
());
i
!=
urls
.
end
();
++
i
)
...
...
jvmaccess/source/unovirtualmachine.cxx
Dosyayı görüntüle @
81da71b6
...
@@ -45,14 +45,14 @@ UnoVirtualMachine::UnoVirtualMachine(
...
@@ -45,14 +45,14 @@ UnoVirtualMachine::UnoVirtualMachine(
rtl
::
Reference
<
jvmaccess
::
VirtualMachine
>
const
&
virtualMachine
,
rtl
::
Reference
<
jvmaccess
::
VirtualMachine
>
const
&
virtualMachine
,
void
*
classLoader
)
:
void
*
classLoader
)
:
m_virtualMachine
(
virtualMachine
),
m_virtualMachine
(
virtualMachine
),
m_classLoader
(
0
)
m_classLoader
(
nullptr
)
{
{
try
{
try
{
m_classLoader
=
m_classLoader
=
jvmaccess
::
VirtualMachine
::
AttachGuard
(
m_virtualMachine
).
jvmaccess
::
VirtualMachine
::
AttachGuard
(
m_virtualMachine
).
getEnvironment
()
->
NewGlobalRef
(
static_cast
<
jobject
>
(
classLoader
));
getEnvironment
()
->
NewGlobalRef
(
static_cast
<
jobject
>
(
classLoader
));
}
catch
(
jvmaccess
::
VirtualMachine
::
AttachGuard
::
CreationException
&
)
{}
}
catch
(
jvmaccess
::
VirtualMachine
::
AttachGuard
::
CreationException
&
)
{}
if
(
m_classLoader
==
0
)
{
if
(
m_classLoader
==
nullptr
)
{
throw
CreationException
();
throw
CreationException
();
}
}
}
}
...
...
jvmaccess/source/virtualmachine.cxx
Dosyayı görüntüle @
81da71b6
...
@@ -49,7 +49,7 @@ VirtualMachine::AttachGuard::AttachGuard(
...
@@ -49,7 +49,7 @@ VirtualMachine::AttachGuard::AttachGuard(
{
{
assert
(
m_xMachine
.
is
());
assert
(
m_xMachine
.
is
());
m_pEnvironment
=
m_xMachine
->
attachThread
(
&
m_bDetach
);
m_pEnvironment
=
m_xMachine
->
attachThread
(
&
m_bDetach
);
if
(
m_pEnvironment
==
0
)
if
(
m_pEnvironment
==
nullptr
)
throw
CreationException
();
throw
CreationException
();
}
}
...
@@ -64,7 +64,7 @@ VirtualMachine::VirtualMachine(JavaVM * pVm, int nVersion, bool bDestroy,
...
@@ -64,7 +64,7 @@ VirtualMachine::VirtualMachine(JavaVM * pVm, int nVersion, bool bDestroy,
m_pVm
(
pVm
),
m_nVersion
(
nVersion
),
m_bDestroy
(
bDestroy
)
m_pVm
(
pVm
),
m_nVersion
(
nVersion
),
m_bDestroy
(
bDestroy
)
{
{
(
void
)
pMainThreadEnv
;
// avoid warnings
(
void
)
pMainThreadEnv
;
// avoid warnings
assert
(
pVm
!=
0
);
assert
(
pVm
!=
nullptr
);
assert
(
nVersion
>=
JNI_VERSION_1_2
);
assert
(
nVersion
>=
JNI_VERSION_1_2
);
assert
(
pMainThreadEnv
);
assert
(
pMainThreadEnv
);
}
}
...
@@ -86,12 +86,12 @@ VirtualMachine::~VirtualMachine()
...
@@ -86,12 +86,12 @@ VirtualMachine::~VirtualMachine()
JNIEnv
*
VirtualMachine
::
attachThread
(
bool
*
pAttached
)
const
JNIEnv
*
VirtualMachine
::
attachThread
(
bool
*
pAttached
)
const
{
{
assert
(
pAttached
!=
0
&&
"bad parameter"
);
assert
(
pAttached
!=
nullptr
&&
"bad parameter"
);
JNIEnv
*
pEnv
;
JNIEnv
*
pEnv
;
jint
n
=
m_pVm
->
GetEnv
(
reinterpret_cast
<
void
**
>
(
&
pEnv
),
m_nVersion
);
jint
n
=
m_pVm
->
GetEnv
(
reinterpret_cast
<
void
**
>
(
&
pEnv
),
m_nVersion
);
SAL_WARN_IF
(
SAL_WARN_IF
(
n
!=
JNI_OK
&&
n
!=
JNI_EDETACHED
,
"jvmaccess"
,
"JNI: GetEnv failed"
);
n
!=
JNI_OK
&&
n
!=
JNI_EDETACHED
,
"jvmaccess"
,
"JNI: GetEnv failed"
);
if
(
pEnv
==
0
)
if
(
pEnv
==
nullptr
)
{
{
if
(
m_pVm
->
AttachCurrentThread
if
(
m_pVm
->
AttachCurrentThread
(
(
...
@@ -102,9 +102,9 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const
...
@@ -102,9 +102,9 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const
// JNIEnv** and not void **
// JNIEnv** and not void **
&
pEnv
,
&
pEnv
,
#endif
#endif
0
)
nullptr
)
!=
JNI_OK
)
!=
JNI_OK
)
return
0
;
return
nullptr
;
*
pAttached
=
true
;
*
pAttached
=
true
;
}
}
else
else
...
...
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