-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source compatibility with version 4.3 and more recent versions of the OSGi core API #110
Comments
@nicoroeser Sounds like a good idea. Just couple of questions, since I don't have much practical experience with OSGi: most code dealing with it, including wrt maven build, has been user contribution. First: just to confirm, suggestion is to change from Felix dependency to https://mvnrepository.com/artifact/org.osgi/org.osgi.core instead? If so, which version (considering that Woodstox 6 still only requires Java 6)? Second: how much user impact would this change have? |
@cowtowncoder, I am sorry but I am not an expert on OSGi or Maven as well. I just noticed the issue because I prepared ebuilds (=package building recipes) on a Gentoo system, and Woodstox is an indirect dependency of the package I like to build. This is why I built it from sources; and as I did not use Maven for building, I noticed the dependency on I had not wanted to suggest to drop Felix. This is because I had not known about the Regarding the version: I have been able to build OSGi core 7.0.0 with While I normally recommend to use the latest versions available (due to included bugfixes and so on), this might have implications for users on different systems. According to section “Dependency Version Ranges” in the Maven reference manual, a What I do recommend (in any case) is to make adjustments to the Woodstox code, especially to class If you indeed like to also switch the |
@nicoroeser Making code compile against multiple versions / packages sounds like a good safe improvement, agreed. Could you suggest diff or PR (and maybe how to test it against by, f.ex, temporarily changing dependency to verify compiling). |
@cowtowncoder, please let’s first try whether you can reproduce the behavior. I have looked at the
If there is a failure in step 1, this suggests that something else is not right. If both steps succeed without changing the Woodstox code, this means that reproduction of this issue is not as easy as I had hoped for. By the way, please do not use |
@nicoroeser I am using JDK 8 for all builds at this point since earlier versions can not be used to actually publish new versions to Maven Central (due to some certificates not being included, or such) without some additional setup work. I can not reproduce any compilation or test failure with |
(removed comment -- looked like I may have misunderstood signatures of method in question) |
For a while was worried there might be bigger incompatibility between |
As per commit comment, made the change to use intermediate variable to cast from |
Filed #133 for actual update -- not 100% sure which OSGi-core dep to upgrade to, but definitely time to do so. Also contemplating on Java 8 update, will file separate issue for that. |
Assuming #133 took care of this; if not, may be re-filed. |
In its subproject Apache Felix OSGi Core, Felix repackages OSGi core as a Maven module. The latest release from Felix is artifact
org.osgi.core
in version 1.4.0. This corresponds to the OSGi core API sources in version 4.2.0. The sources from OSGi and from Felix carry the date 2009-09-01 each.(Side note: it seems that
osgi.core-4.2.1
sources from OSGi have been made available at some point in time but I cannot find an official download for them.)Woodstox currently depends on the Felix OSGi release (version 1.4.0 of it). OSGi has released version 7 of the OSGi core API in 2018.
Version 4.3 of the upstream OSGi sources introduces changes which are still binary compatible but in some parts not source compatible with earlier versions. This is due to the introduction of Java generics in version 4.3 of the OSGi core API. The OSGi Service Platform Core Specification, Release 4, Version 4.3 (via OSGi Specifications page) explains this in detail in section 1.4 (“Migration to Generics”) on pages 7 and 8.
The current woodstox code fails to compile with OSGi core API versions 4.3 or later due to these source incompatibilities:
woodstox/src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java
Lines 30 to 36 in 5f384b8
java.util.Properties
(without generics) where ajava.util.Dictionary<String,?>
is expected.I’d like to suggest to update the Woodstox code so that it will also be compatible with more recent OSGi core API releases/versions. Even when they have not yet been made available as Maven modules through Felix.
The text was updated successfully, but these errors were encountered: