diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-04-04 22:46:53 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-04-05 00:18:50 +0300 |
commit | b7525f1f1d123084b60269f420300afdd405b0d1 (patch) | |
tree | 0b2e32b3879a27802c0e607b187c1b43ab697c9e /jvmaccess/source | |
parent | f5928f09ad53de2c4683000619d29be140a97be8 (diff) |
Drop jvmaccess and jvmfwk when no SOLAR_JAVA
Just sprinkle #ifdef SOLAR_JAVA into the code instead.
In the source for jvmaccess and jvmfwk such ifdefs can be removed as
it isn't compiled unless SOLAR_JAVA.
Change-Id: Ia8614f8bd6d833582d3b79b5fb75f9153fa79606
Diffstat (limited to 'jvmaccess/source')
-rw-r--r-- | jvmaccess/source/classpath.cxx | 17 | ||||
-rw-r--r-- | jvmaccess/source/unovirtualmachine.cxx | 8 | ||||
-rw-r--r-- | jvmaccess/source/virtualmachine.cxx | 9 |
3 files changed, 0 insertions, 34 deletions
diff --git a/jvmaccess/source/classpath.cxx b/jvmaccess/source/classpath.cxx index f0513352c550..4891cc27876a 100644 --- a/jvmaccess/source/classpath.cxx +++ b/jvmaccess/source/classpath.cxx @@ -36,16 +36,13 @@ #include "rtl/ustring.hxx" #include "sal/types.h" -#if defined SOLAR_JAVA #include "jni.h" -#endif void * ::jvmaccess::ClassPath::doTranslateToUrls( css::uno::Reference< css::uno::XComponentContext > const & context, void * environment, ::rtl::OUString const & classPath) { OSL_ASSERT(context.is() && environment != 0); -#if defined SOLAR_JAVA ::JNIEnv * const env = static_cast< ::JNIEnv * >(environment); jclass classUrl(env->FindClass("java/net/URL")); if (classUrl == 0) { @@ -104,12 +101,6 @@ void * ::jvmaccess::ClassPath::doTranslateToUrls( env->SetObjectArrayElement(result, idx++, *i); } return result; -#else - (void) context; - (void) environment; - (void) classPath; - return 0; -#endif } void * ::jvmaccess::ClassPath::doLoadClass( @@ -118,7 +109,6 @@ void * ::jvmaccess::ClassPath::doLoadClass( ::rtl::OUString const & name) { OSL_ASSERT(context.is() && environment != 0); -#if defined SOLAR_JAVA ::JNIEnv * const env = static_cast< ::JNIEnv * >(environment); jclass classLoader(env->FindClass("java/net/URLClassLoader")); if (classLoader == 0) { @@ -151,13 +141,6 @@ void * ::jvmaccess::ClassPath::doLoadClass( return 0; } return env->CallObjectMethodA(cl, methLoadClass, &arg); -#else - (void) context; - (void) environment; - (void) classPath; - (void) name; - return 0; -#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/jvmaccess/source/unovirtualmachine.cxx b/jvmaccess/source/unovirtualmachine.cxx index dc2d680f5b14..66c181dfaa39 100644 --- a/jvmaccess/source/unovirtualmachine.cxx +++ b/jvmaccess/source/unovirtualmachine.cxx @@ -25,9 +25,7 @@ #include "jvmaccess/virtualmachine.hxx" -#if defined SOLAR_JAVA #include "jni.h" -#endif namespace jvmaccess { @@ -50,15 +48,11 @@ UnoVirtualMachine::UnoVirtualMachine( m_virtualMachine(virtualMachine), m_classLoader(0) { -#if defined SOLAR_JAVA try { m_classLoader = jvmaccess::VirtualMachine::AttachGuard(m_virtualMachine). getEnvironment()->NewGlobalRef(static_cast< jobject >(classLoader)); } catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) {} -#else - (void) classLoader; -#endif if (m_classLoader == 0) { throw CreationException(); } @@ -74,7 +68,6 @@ void * UnoVirtualMachine::getClassLoader() const { } UnoVirtualMachine::~UnoVirtualMachine() { -#if defined SOLAR_JAVA try { jvmaccess::VirtualMachine::AttachGuard(m_virtualMachine). getEnvironment()->DeleteGlobalRef( @@ -84,7 +77,6 @@ UnoVirtualMachine::~UnoVirtualMachine() { "jvmaccess::UnoVirtualMachine::~UnoVirtualMachine:" " jvmaccess::VirtualMachine::AttachGuard::CreationException" ); } -#endif } } diff --git a/jvmaccess/source/virtualmachine.cxx b/jvmaccess/source/virtualmachine.cxx index f6500f9265c7..23192ab3e437 100644 --- a/jvmaccess/source/virtualmachine.cxx +++ b/jvmaccess/source/virtualmachine.cxx @@ -61,10 +61,8 @@ VirtualMachine::VirtualMachine(JavaVM * pVm, int nVersion, bool bDestroy, m_pVm(pVm), m_nVersion(nVersion), m_bDestroy(bDestroy) { (void) pMainThreadEnv; // avoid warnings -#ifdef SOLAR_JAVA OSL_ENSURE(pVm != 0 && nVersion >= JNI_VERSION_1_2 && pMainThreadEnv != 0, "bad parameter"); -#endif } VirtualMachine::~VirtualMachine() @@ -84,10 +82,6 @@ VirtualMachine::~VirtualMachine() JNIEnv * VirtualMachine::attachThread(bool * pAttached) const { -#ifndef SOLAR_JAVA - (void) pAttached; - return 0; -#else OSL_ENSURE(pAttached != 0, "bad parameter"); JNIEnv * pEnv; jint n = m_pVm->GetEnv(reinterpret_cast< void ** >(&pEnv), m_nVersion); @@ -113,16 +107,13 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const else *pAttached = false; return pEnv; -#endif } void VirtualMachine::detachThread() const { -#ifdef SOLAR_JAVA if (m_pVm->DetachCurrentThread() != JNI_OK) { OSL_FAIL("JNI: DetachCurrentThread failed"); } -#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |