weird typo in method name

18 views
Skip to first unread message

P5music

unread,
Apr 15, 2021, 10:19:28 AM4/15/21
to CodenameOne Discussions
I do not know if it is useful but
I noticed that in code like

webView.addJSCallback("javascript code here;callback.onSuccess();",
new SuccessCallback<BrowserComponent.JSRef>() {
@Override
public void onSucess(BrowserComponent.JSRef value) {
System.out.println("success");
}
});

the method name onSuccess of
SuccessCallback<BrowserComponent.JSRef>
is written as onSucess (just one 'c')
while the callback method is called successfully from javascript using callback.onSuccess().
It is harmless for my project, in fact.

Did you know it?
Regards

Shai Almog

unread,
Apr 15, 2021, 11:53:05 PM4/15/21
to CodenameOne Discussions
The interface was deprecated because of the typo but some APIs still use the old deprecated version.

P5music

unread,
Apr 16, 2021, 2:14:34 AM4/16/21
to CodenameOne Discussions
What interface should I use in replacement?
I see that using onSuccess (two 'c') gives error because it is not an Override.
Regards

Shai Almog

unread,
Apr 16, 2021, 11:42:04 PM4/16/21
to CodenameOne Discussions
Some methods weren't updated to work with that newer interface so it's irrelevant if this one hasn't. That's a bug and it needs to be fixed.
Reply all
Reply to author
Forward
0 new messages