You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot add annotations to JCW for methods that implement interface methods #11853
You want to implement DoSomething.Do () in C# and apply the [JavascriptInterface] attribute to it, hoping the @JavascriptInterface Java annotation will be added to your JCW method.
If Do () was an override to a Java class method this would work. However when we generate JCWs for implemented interface methods, we do not consider what the user has written. We (correctly) assume that the user has provided an implementation for every required interface method. That is, we generate a JCW method for every method we find on implemented interfaces.
Because we ignore what the user has written when generating the JCW method, we will not see that they have added an attribute to their method, and we will not add the requested Java annotation to the JCW method.
To fix this, we need to figure out which methods in the user's code implements an interface method so we can apply any attributes the user has added to the JCW method.
Note that the implementation for this is likely quite complex. We will have to build a map between the user's methods and the implemented interface methods so we can determine which user methods are interface implementations and which aren't. This also gets more complicated with things like generics, explicit interface implementations, and default interface methods.
We suspect this issue is stale and no longer relevant. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This issue will now be closed since it had been marked "possibly-stale" but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.
Activity
chore: Fix Given_WebView2.When_LocalFolder_File()
dotnet-policy-service commentedon Jul 1, 2026
We suspect this issue is stale and no longer relevant. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
dotnet-policy-service commentedon Jul 15, 2026
This issue will now be closed since it had been marked "possibly-stale" but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.