Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another default methods with @JImplements problem #1256

Open
ryanmkurtz opened this issue Jan 24, 2025 · 1 comment
Open

Another default methods with @JImplements problem #1256

ryanmkurtz opened this issue Jan 24, 2025 · 1 comment

Comments

@ryanmkurtz
Copy link
Contributor

ryanmkurtz commented Jan 24, 2025

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.

@Thrameos
Copy link
Contributor

I thought this was dealt with. I will take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants