diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-02-25 10:37:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-02-25 10:37:10 +0100 |
commit | f66d734bcd994cb5fc2f38a8d9018e13385cd10c (patch) | |
tree | c922840fcce94dfe49c3d601b1d9fb389286f29b /connectivity/source/commontools/CommonTools.cxx | |
parent | d79a413736317e39bf17786f4cabb0f4ac0d2a75 (diff) |
The XJavaVM.getJavaVM return value can always be extracted to sal_Int64
(avoids warning with MSVC 2015)
Change-Id: I9b3c5bc26a1e3df88a03e5fb295eb6a8fb63f824
Diffstat (limited to 'connectivity/source/commontools/CommonTools.cxx')
-rw-r--r-- | connectivity/source/commontools/CommonTools.cxx | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx index 8a0f25b2d316..edc40bb1f8ea 100644 --- a/connectivity/source/commontools/CommonTools.cxx +++ b/connectivity/source/commontools/CommonTools.cxx @@ -129,23 +129,12 @@ namespace connectivity processID[16] = 0; Any uaJVM = xVM->getJavaVM( processID ); - - if (!uaJVM.hasValue()) + sal_Int64 nTemp; + if (!(uaJVM >>= nTemp)) { throw Exception(); // -5 - else - { - sal_Int32 nValue = 0; - jvmaccess::VirtualMachine* pJVM = nullptr; - if ( uaJVM >>= nValue ) - pJVM = reinterpret_cast< jvmaccess::VirtualMachine* > (nValue); - else - { - sal_Int64 nTemp = 0; - uaJVM >>= nTemp; - pJVM = reinterpret_cast< jvmaccess::VirtualMachine* > (nTemp); - } - aRet = pJVM; } + aRet = reinterpret_cast<jvmaccess::VirtualMachine *>( + static_cast<sal_IntPtr>(nTemp)); } catch (Exception&) { |