Another default methods with @JImplements problem
I suppose this relates to #1181 and #1182.
I am trying to implement this Ghidra interface in PyGhidra with JPype like this:
@JImplements(BundleHostListener)
class PyListener:
"""
PyGhidra Bundle Host Listener
"""
def __init__(self, py_plugin: PyGhidraPlugin):
pass
@JOverride
def bundleBuilt(self, bundle, summary):
print("bundleBuilt")
@JOverride
def bundleEnablementChange(self, bundle, newEnablement):
print("bundleEnablementChange")
...
Things blow up at runtime if I don't implement every method in the interface, despite them all have default implementations. For example, if I don't override bunldesAdded():
java.lang.reflect.UndeclaredThrowableException: null
jdk.proxy2/jdk.proxy2.$Proxy32.bundlesAdded(Unknown Source)
ghidra.app.plugin.core.osgi.BundleHost.fireBundlesAdded(BundleHost.java:814)
ghidra.app.plugin.core.osgi.BundleHost.add(BundleHost.java:214)
ghidra.app.plugin.core.osgi.BundleHost.restoreManagedBundleState(BundleHost.java:890)
ghidra.app.plugin.core.script.GhidraScriptComponentProvider.readConfigState(GhidraScriptComponentProvider.java:293)
Not a blocker for me, since I can just implement all of them. But, seems like a bug.
I thought this was dealt with. I will take another look.
I have the same issue with Jpype version 1.5.2, as said previously this is not a blocking stuff but this is bothersome.
Its on the list. But I don't have a simple replicator of the error that doesn't require 3rd party libraries, so it is waiting until I can create one.
I tested this again with the examples I have. I was not required to implement defaults on a simple class extension. Thus there is something confusing in the your case. I will need a reproducer to continue. It is likely something about the organization of the class inheritance.