Menu

#182 using nested classes

5.1
open
None
2
2014-09-15
2014-09-12
No

Hi,
I have a problem developing a project, that uses Knopflerfish. I'm using:
Eclipse Luna
Knopflerfish 5.1.0
Knopflerfish-eclipse-plugin 1.2.2
I have a knopflerfish bundle ("bundle1") with a package called "a". This package contains a class called "A", which contains a nested class called "B":

public class A {
public static class B {
}
}

"bundle1" exports the package "a".

Now, if in another bundle ("bundle2"), I try to use "B", Eclipse signals an error, saying:

  • The package a.A is used but not imported in manifest.
    The error is solved adding to the manifest of "bundle2" in Imported-packages: a.A, but, in this way, there is an error at runtime, because Knopflerfish says (rightly!) that there is no bundle exporting a.A.

It seems strange that Knopflerfish can't handle nested classes...is this a bug of the Knopflerfish eclipse plugin? Is there a solution to workaround this problem (I cannot modify the structure of class A). I think that the problem is due to the fact that the canonical name of the class B is "a.A.B" and somewhere in the code (probably in the eclipse plugin) all the part of the canonical name before the last "." is considered as the class package and for this reason, eclipse requires to insert "a.A" as imported-packages.

I have already inserted the question in the forum, but without responses.

Thanks in advance,
Davide

Discussion

  • Jan Stein

    Jan Stein - 2014-09-15
    • assigned_to: Anders Rimén
     
  • Jan Stein

    Jan Stein - 2014-09-15

    It seems to be some problem with the eclipse plugin.

     
  • Davide Conzon

    Davide Conzon - 2014-09-15

    Analyzing the source code of the eclipse-plugin available on svn, I think that the problem is located in org.knopflerfish.core.project.BundleProject in the method getReferencedPackageNames().

     

Log in to post a comment.

MongoDB Logo MongoDB