[Libreoffice-commits] core.git: 3 commits - connectivity/source cppuhelper/source include/sal jvmfwk/Module_jvmfwk.mk jvmfwk/Package_jreproperties_solver.mk jvmfwk/Package_rcfiles_solver.mk

Andrzej J.R. Hunt andrzej at ahunt.org
Mon Sep 16 02:40:26 PDT 2013


 connectivity/source/drivers/hsqldb/HDriver.cxx |   16 ++++++++++-
 connectivity/source/drivers/jdbc/JDriver.cxx   |   15 ++++++++++
 cppuhelper/source/unorc                        |    1 
 include/sal/log-areas.dox                      |    2 +
 jvmfwk/Module_jvmfwk.mk                        |    2 +
 jvmfwk/Package_jreproperties_solver.mk         |   20 ++++++++++++++
 jvmfwk/Package_rcfiles_solver.mk               |   35 +++++++++++++++++++++++++
 7 files changed, 89 insertions(+), 2 deletions(-)

New commits:
commit 6eb840cc540bb6f2efcebc0349a8e6e7ba074cd8
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Sat Sep 14 08:09:38 2013 +0100

    Set URE_INTERNAL_JAVA_DIR for unorc to allow jvm in unit tests.
    
    Currently unit tests run in solver, the unorc in solver is simply
    copied from cppuhelper/source/unorc, which doesn't set
    URE_INTERNAL_JAVA_DIR, hence the jvm cannot be loaded in Unit tests.
    
    (For comparison the URE unorc in instdir is copied from ure/source/uno{rc,.ini}
    and contains the appropriate java paths.)
    
    (URE_INTERNAL_JAVA_CLASSPATH is not needed, at least currently.)
    
    Change-Id: I5911c9a22c92e0e20c98d0e51d5b14e020c8ec10
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>, slightly modified

diff --git a/cppuhelper/source/unorc b/cppuhelper/source/unorc
index d6bf696..48c8b0c 100644
--- a/cppuhelper/source/unorc
+++ b/cppuhelper/source/unorc
@@ -18,5 +18,6 @@
 
 [Bootstrap]
 URE_INTERNAL_LIB_DIR=${ORIGIN}
+URE_INTERNAL_JAVA_DIR=${ORIGIN}/../bin
 UNO_SERVICES=${URE_MORE_SERVICES}
 UNO_TYPES=${ORIGIN}/../bin/udkapi.rdb ${URE_MORE_TYPES}
commit 429042021590c80afb25ade833269635a24f2778
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Sep 16 11:28:51 2013 +0200

    Make Java-based connectivity drivers work with jvmfwk "direct mode"
    
    ...so they work from CppunitTests (which make use of that "direct mode").
    
    Change-Id: I92b72fb708ac1868644111b208f92ac58610ed11

diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index 5f053f3..f916658 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -400,7 +400,21 @@ namespace connectivity
     sal_Bool SAL_CALL ODriverDelegator::acceptsURL( const OUString& url ) throw (SQLException, RuntimeException)
     {
         sal_Bool bEnabled = sal_False;
-        OSL_VERIFY_EQUALS( jfw_getEnabled( &bEnabled ), JFW_E_NONE, "error in jfw_getEnabled" );
+        javaFrameworkError e = jfw_getEnabled(&bEnabled);
+        switch (e) {
+        case JFW_E_NONE:
+            break;
+        case JFW_E_DIRECT_MODE:
+            SAL_INFO(
+                "connectivity.hsqldb",
+                "jfw_getEnabled: JFW_E_DIRECT_MODE, assuming true");
+            bEnabled = true;
+            break;
+        default:
+            SAL_WARN(
+                "connectivity.hsqldb", "jfw_getEnabled: error code " << +e);
+            break;
+        }
         return bEnabled  && url.equals("sdbc:embedded:hsqldb");
     }
 
diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx
index d0759c1..05424ae 100644
--- a/connectivity/source/drivers/jdbc/JDriver.cxx
+++ b/connectivity/source/drivers/jdbc/JDriver.cxx
@@ -117,7 +117,20 @@ sal_Bool SAL_CALL java_sql_Driver::acceptsURL( const OUString& url ) throw(SQLEx
     // don't ask the real driver for the url
     // I feel responsible for all jdbc url's
     sal_Bool bEnabled = sal_False;
-    OSL_VERIFY_EQUALS( jfw_getEnabled( &bEnabled ), JFW_E_NONE, "error in jfw_getEnabled" );
+    javaFrameworkError e = jfw_getEnabled(&bEnabled);
+    switch (e) {
+    case JFW_E_NONE:
+        break;
+    case JFW_E_DIRECT_MODE:
+        SAL_INFO(
+            "connectivity.jdbc",
+            "jfw_getEnabled: JFW_E_DIRECT_MODE, assuming true");
+        bEnabled = true;
+        break;
+    default:
+        SAL_WARN("connectivity.jdbc", "jfw_getEnabled: error code " << +e);
+        break;
+    }
     return bEnabled && url.startsWith("jdbc:");
 }
 // -------------------------------------------------------------------------
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 6589382..ad99b89 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -58,6 +58,8 @@ certain functionality.
 @li @c connectivity.commontools
 @li @c connectivity.drivers
 @li @c connectivity.firebird
+ at li @c connectivity.hsqldb
+ at li @c connectivity.jdbc
 @li @c connectivity.mork
 @li @c connectivity.flat
 @li @c connectivity.parse
commit a041f518afe083f997660eb8f809df7f20c30fed
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Sep 16 11:25:47 2013 +0200

    Still copy jvmfwk support files to solver
    
    ...instead of only to instdir, as happened after
    2e47462d076364725875e770a91a7bb6bbbec2c1 "jvmfwk: install also into instdir," so
    that CppunitTests (which still run against solver) can use jvmfwk.  This will
    become moot when solver is eventually dropped.
    
    Change-Id: Ic2cdbf32e20a79f8cc6ac2088e4bc47dcd6f5cc5

diff --git a/jvmfwk/Module_jvmfwk.mk b/jvmfwk/Module_jvmfwk.mk
index 00fd9c5..e5caeba 100644
--- a/jvmfwk/Module_jvmfwk.mk
+++ b/jvmfwk/Module_jvmfwk.mk
@@ -16,7 +16,9 @@ $(eval $(call gb_Module_add_targets,jvmfwk,\
 	Library_jvmfwk \
 	Library_sunjavaplugin \
 	Package_jreproperties \
+	Package_jreproperties_solver \
 	Package_rcfiles \
+	Package_rcfiles_solver \
 ))
 
 ifneq (,$(filter-out MACOSX WNT,$(OS)))
diff --git a/jvmfwk/Package_jreproperties_solver.mk b/jvmfwk/Package_jreproperties_solver.mk
new file mode 100644
index 0000000..4cecdcc
--- /dev/null
+++ b/jvmfwk/Package_jreproperties_solver.mk
@@ -0,0 +1,20 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+ifeq ($(OS),WNT)
+jvmfwk_Package_jreproperties_solver_LIBDIR := bin
+else
+jvmfwk_Package_jreproperties_solver_LIBDIR := lib
+endif
+
+$(eval $(call gb_Package_Package,jvmfwk_jreproperties_solver,$(call gb_CustomTarget_get_workdir,jvmfwk/jreproperties)))
+
+$(eval $(call gb_Package_add_file,jvmfwk_jreproperties_solver,$(jvmfwk_Package_jreproperties_solver_LIBDIR)/JREProperties.class,JREProperties.class))
+
+# vim:set noet sw=4 ts=4:
diff --git a/jvmfwk/Package_rcfiles_solver.mk b/jvmfwk/Package_rcfiles_solver.mk
new file mode 100644
index 0000000..3571632
--- /dev/null
+++ b/jvmfwk/Package_rcfiles_solver.mk
@@ -0,0 +1,35 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+ifeq ($(OS),WNT)
+jvmfwk_Package_rcfiles_solver_LIBDIR := bin
+else
+jvmfwk_Package_rcfiles_solver_LIBDIR := lib
+endif
+
+$(eval $(call gb_Package_Package,jvmfwk_rcfiles_solver,$(SRCDIR)/jvmfwk))
+
+$(eval $(call gb_Package_add_file,jvmfwk_rcfiles_solver,$(jvmfwk_Package_rcfiles_solver_LIBDIR)/$(call gb_Helper_get_rcfile,jvmfwk3),source/jvmfwk3rc))
+$(eval $(call gb_Package_add_file,jvmfwk_rcfiles_solver,$(jvmfwk_Package_rcfiles_solver_LIBDIR)/$(call gb_Helper_get_rcfile,sunjavaplugin),plugins/sunmajor/pluginlib/sunjavapluginrc))
+
+ifeq ($(OS),AIX)
+$(eval $(call gb_Package_add_file,jvmfwk_rcfiles_solver,$(jvmfwk_Package_rcfiles_solver_LIBDIR)/javavendors.xml,distributions/OpenOfficeorg/javavendors_linux.xml))
+else ifeq ($(OS),FREEBSD)
+$(eval $(call gb_Package_add_file,jvmfwk_rcfiles_solver,$(jvmfwk_Package_rcfiles_solver_LIBDIR)/javavendors.xml,distributions/OpenOfficeorg/javavendors_freebsd.xml))
+else ifeq ($(OS),LINUX)
+$(eval $(call gb_Package_add_file,jvmfwk_rcfiles_solver,$(jvmfwk_Package_rcfiles_solver_LIBDIR)/javavendors.xml,distributions/OpenOfficeorg/javavendors_linux.xml))
+else ifeq ($(OS),MACOSX)
+$(eval $(call gb_Package_add_file,jvmfwk_rcfiles_solver,$(jvmfwk_Package_rcfiles_solver_LIBDIR)/javavendors.xml,distributions/OpenOfficeorg/javavendors_macosx.xml))
+else ifeq ($(OS),WNT)
+$(eval $(call gb_Package_add_file,jvmfwk_rcfiles_solver,$(jvmfwk_Package_rcfiles_solver_LIBDIR)/javavendors.xml,distributions/OpenOfficeorg/javavendors_wnt.xml))
+else
+$(eval $(call gb_Package_add_file,jvmfwk_rcfiles_solver,$(jvmfwk_Package_rcfiles_solver_LIBDIR)/javavendors.xml,distributions/OpenOfficeorg/javavendors_unx.xml))
+endif
+
+# vim:set noet sw=4 ts=4:


More information about the Libreoffice-commits mailing list