[ 
https://issues.apache.org/jira/browse/PYLUCENE-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17061259#comment-17061259
 ] 

Andreas Vajda commented on PYLUCENE-53:
---------------------------------------

I took a closer look at this today. Thank you for the very useful reproduction 
case !
The reason this doesn't work is not because Being's default getFeet() 
implementation is not wrapped, it is. It's because JCC doesn't support multiple 
inheritance.
The Cat class extends Feline and implements Being, which turns into two C++ 
parent classes (and it uses only the one class superclass, not the interface 
superclass(es)).
The reason this bug hasn't bitten as hard until now is that the multiple 
inheritance is "faked" by way of the required local implementations of all the 
Being methods on Cat. For Cat not to be abstract, it had to implement *all* the 
methods defined on Being, until this no longer held true by way of Java 8's 
default implementation method feature.
I have tried in the past to support multiple C++ superclasses but have not been 
able to make it work. This bug is making the need more pressing.

> JCC Default implementations from Interfaces not exposed
> -------------------------------------------------------
>
>                 Key: PYLUCENE-53
>                 URL: https://issues.apache.org/jira/browse/PYLUCENE-53
>             Project: PyLucene
>          Issue Type: Bug
>            Reporter: Petrus Hyvönen
>            Priority: Major
>         Attachments: Test_default_implementation.zip
>
>
> Hi,
> This may be related to PYLUCENE-27 but not sure.
> Default implementations of methods in an interface does not seem to be 
> exposed currently.
> For example:
> The interface:
> interface Being {
>  public void printName();
>  default int getFeets()
>  {
>  return 4;
>  }
> }
> Implemented in the class:
> public class Cat extends Feline implements Being {
>  public void printName() {
>  System.out.println("Cat");
>  }
>  public int getJavaFeets()
>  {
>  return this.getFeets();
>  }
> }
> When wrapped in Python, the getJavaFeets is exposed to the Python side, but 
> not the getFeets method.
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to