[libwoodstox-java] 05/07: Fix an interface mismatch with osgi.

Giovanni Mascellani gio at moszumanska.debian.org
Sat Sep 10 16:44:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

gio pushed a commit to branch master
in repository libwoodstox-java.

commit 8173468636e6d903c7c468d46f556448a312a4c1
Author: Giovanni Mascellani <gio at debian.org>
Date:   Sat Sep 10 17:59:13 2016 +0200

    Fix an interface mismatch with osgi.
---
 ...erface-mismatch-between-woodstox-and-osgi.patch | 45 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 46 insertions(+)

diff --git a/debian/patches/0001-Fix-interface-mismatch-between-woodstox-and-osgi.patch b/debian/patches/0001-Fix-interface-mismatch-between-woodstox-and-osgi.patch
new file mode 100644
index 0000000..a5f18ee
--- /dev/null
+++ b/debian/patches/0001-Fix-interface-mismatch-between-woodstox-and-osgi.patch
@@ -0,0 +1,45 @@
+From: Giovanni Mascellani <gio at debian.org>
+Date: Sat, 10 Sep 2016 17:58:31 +0200
+Subject: Fix interface mismatch between woodstox and osgi.
+
+In registerService() recent osgi versions expect properties to be
+passed as a Dictionary<String, ?> object , while woodstox tries to
+pass a Properties object, which implements Dictionary<Object,
+Object> (which actually contains elements of type <String, Object>).
+
+In this patch the Java type checker is forced to accept this code
+by converting the object to an intermediate Hashtable type, without
+specifying generic types.
+---
+ src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java b/src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java
+index 0ad8402..37d9cb9 100644
+--- a/src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java
++++ b/src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java
+@@ -1,5 +1,7 @@
+ package com.ctc.wstx.osgi;
+ 
++import java.util.Hashtable;
++
+ import org.osgi.framework.BundleActivator;
+ import org.osgi.framework.BundleContext;
+ 
+@@ -27,13 +29,13 @@ public class WstxBundleActivator
+     public void start(BundleContext ctxt)
+     {
+         InputFactoryProviderImpl inputP = new InputFactoryProviderImpl();
+-        ctxt.registerService(Stax2InputFactoryProvider.class.getName(), inputP, inputP.getProperties());
++        ctxt.registerService(Stax2InputFactoryProvider.class.getName(), inputP, new Hashtable(inputP.getProperties()));
+         OutputFactoryProviderImpl outputP = new OutputFactoryProviderImpl();
+-        ctxt.registerService(Stax2OutputFactoryProvider.class.getName(), outputP, outputP.getProperties());
++        ctxt.registerService(Stax2OutputFactoryProvider.class.getName(), outputP, new Hashtable(outputP.getProperties()));
+         ValidationSchemaFactoryProviderImpl[] impls = ValidationSchemaFactoryProviderImpl.createAll();
+         for (int i = 0, len = impls.length; i < len; ++i) {
+             ValidationSchemaFactoryProviderImpl impl = impls[i];
+-            ctxt.registerService(Stax2ValidationSchemaFactoryProvider.class.getName(), impl, impl.getProperties());
++            ctxt.registerService(Stax2ValidationSchemaFactoryProvider.class.getName(), impl, new Hashtable(impl.getProperties()));
+         }
+     }
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8fe6784
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Fix-interface-mismatch-between-woodstox-and-osgi.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libwoodstox-java.git



More information about the pkg-java-commits mailing list