On 6/26/12 12:57 , [email protected] wrote:
I just migrated from java6 --> java7.
During compilation, I get a lot of errors pertaining to generic typing on
classes from felix, version 4.0.2; I've put the compilation errors at the
bottom of this message.
Here's something I found that suggests that the felix source might not be
compiled with java 1.7?
https://github.com/osgi/bindex/issues/11
The Felix framework targets jsr14, which allowed it to take advantage of
generics, but still have byte code compatible with JDK 1.4. If you are
compiling against the framework JAR file in Java 7, then you need to
recompile the framework using Java 7 (i.e., get rid of target jsr14). Of
course, you could just get an OSGi API JAR compiled for Java 5 or above,
since you likely don't need to compile against Felix framework internals...
The coming framework 4.2.0 release will target Java 5 instead of jsr14,
so this issue should go away in the future.
-> richard
Any thoughts?
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/support/FakeBundleContext.java:[28,31] error: type ServiceRegistration does
not take parameters
/support/FakeBundleContext.java:[39,39] error: type ServiceReference does not
take parameters
/support/FakeBundleContext.java:[45,28] error: type ServiceReference does not
take parameters
/support/FakeBundleContext.java:[19,7] error: FakeBundleContext is not abstract
and does not override abstract method getServiceReferences(Class,String) in
BundleContext
/support/FakeBundleContext.java:[28,35] error: name clash:
<S>registerService(Class<S>,S,Dictionary<String,?>) in FakeBundleContext and
registerService(Class,Object,Dictionary) in BundleContext have the same erasure, yet neither
overrides the other
where S is a type-variable:
S extends Object declared in method
<S>registerService(Class<S>,S,Dictionary<String,?>)
/support/FakeBundleContext.java:[27,1] error: method does not override or
implement a method from a supertype
/support/FakeBundleContext.java:[39,44] error: name clash:
<S>getServiceReferences(Class<S>,String) in FakeBundleContext and
getServiceReferences(Class,String) in BundleContext have the same erasure, yet neither
overrides the other
where S is a type-variable:
S extends Object declared in method
<S>getServiceReferences(Class<S>,String)
/support/FakeBundleContext.java:[38,1] error: method does not override or
implement a method from a supertype
/support/FakeBundleContext.java:[45,32] error: name clash:
<S>getServiceReference(Class<S>) in FakeBundleContext and
getServiceReference(Class) in BundleContext have the same erasure, yet neither overrides
the other
where S is a type-variable:
S extends Object declared in method <S>getServiceReference(Class<S>)
/support/FakeBundleContext.java:[44,1] error: method does not override or
implement a method from a supertype
/support/FakeBundle.java:[17,7] error: FakeBundle is not abstract and does not
override abstract method adapt(Class) in Bundle
/support/FakeBundle.java:[186,1] error: method does not override or implement a
method from a supertype
/support/FakeBundle.java:[191,14] error: name clash: <A>adapt(Class<A>) in
FakeBundle and adapt(Class) in Bundle have the same erasure, yet neither overrides the other
where A is a type-variable:
A extends Object declared in method <A>adapt(Class<A>)
/support/FakeBundle.java:[190,1] error: method does not override or implement a
method from a supertype
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue Jun 26 10:51:00 MDT 2012
[INFO] Final Memory: 45M/510M
[INFO] ------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]