Skip to main content



      Home
Home » Eclipse Projects » P2 » Errors related to Generics while compiling OSGi-Equinox dependent code with JDK 1.7(Errors related to Generics while compiling OSGi-Equinox dependent code with JDK 1.7)
Errors related to Generics while compiling OSGi-Equinox dependent code with JDK 1.7 [message #991475] Wed, 19 December 2012 07:11 Go to next message
Eclipse UserFriend
We have a OSGi/Equinox dependent code that is compiling fine with JDK 1.6. However, when we compile the same with JDK 1.7, we end up in compilation errors related to generics for the implemented or overridden methods.

To reproduce the problem as a standalone application, I have created a Java Class (OsgiBundleImpl.java) that implements the org.osgi.framework.Bundle interface. On compiling the same it gives the following error :

javac -cp ..\lib\org.eclipse.osgi_3.8.0.v20120529-1548.jar -d ..\bin OsgiBundleImpl.java
OsgiBundleImpl.java:94: error: type ServiceReference does not take parameters
public ServiceReference<?>[] getRegisteredServices() {
^
OsgiBundleImpl.java:112: error: type ServiceReference does not take parameters
public ServiceReference<?>[] getServicesInUse() {
^
OsgiBundleImpl.java:19: error: OsgiBundleImpl is not abstract and does not override abstract method adapt(Class) in Bundle
public class OsgiBundleImpl<A> implements Bundle {
^
OsgiBundleImpl.java:21: error: method does not override or implement a method from a supertype
@Override
^
OsgiBundleImpl.java:28: error: name clash: <A>adapt(Class<A>) in OsgiBundleImpl
and adapt(Class) in Bundle have the same erasure, yet neither overrides the other
public <A> A adapt(Class<A> arg0) {
^
where A is a type-variable:
A extends Object declared in method <A>adapt(Class<A>)
OsgiBundleImpl.java:27: error: method does not override or implement a method from a supertype
@Override
^
6 errors


Do we have any workaround like a javac/JVM flag that would enable the compilation of OsgiBundleImpl.java
  • Attachment: sample.zipx
    (Size: 1.22MB, Downloaded 415 times)
Re: Errors related to Generics while compiling OSGi-Equinox dependent code with JDK 1.7 [message #1015495 is a reply to message #991475] Thu, 28 February 2013 14:27 Go to previous message
Eclipse UserFriend
Could be about: http://mail-archives.apache.org/mod_mbox/felix-users/201201.mbox/%3C4F030C3A.8040806@googlemail.com%3E
Previous Topic:URI is not hierarchical
Next Topic:Blending Packages
Goto Forum:
  


Current Time: Tue Jun 17 08:04:06 EDT 2025

Powered by FUDForum. Page generated in 0.46164 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top