Hello folks,
I have a riddle to solve here and I hope someone had the same or a similar problem and can tell me.
I have an event routine that is triggered by a custom view (see below) The Custom View has a getName property.
This is queried with a Callsub routine. (Since several views call the same event, the name decides what happens next.)
Now the following happens when an event is triggered in debug mode:
- The subexist routine correctly recognizes the getName property
- if callsub(sender,"getname") is now called, I get an error with the following stack trace (the entire stack trace below).
Caused by: java.lang.RuntimeException: java.lang.Exception:
Sub getname signature does not match expected signature. at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336) at anywheresoftware.b4a.debug.Debug.CallSubNew(Debug.java:282) ...
32 more Caused by: java.lang.Exception:
Sub getname signature does not match expected signature. at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:321) ...
33 more
However, the signature is completely correct, unfortunately it is not that simple.
The error is only thrown in debug mode.
The release mode runs without any problems, as does the debug mode if the event routine is provided with a breakpoint and is debugged.
Likewise, there is no error in the Legacy Debugger.
Of course there are alternatives to my approach without Callsub.
However, I just want to understand what is happening here.
Or is it a bug in deb mode?
I am happy about every hint.
The Event Code:
the complete stacktrace of error message:
Error occurred on line: 103 (EditAndStoreAlarmForm)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug(Common.java:1082)
at de.peter.testlib.editandstorealarmform._alarmsetup_click(editandstorealarmform.java:155)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1114)
at anywheresoftware.b4a.keywords.Common.CallSubNew(Common.java:1061)
at de.hp_mais.cvlib.cvtextlink._lview_click(cvtextlink.java:400)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1114)
at anywheresoftware.b4a.keywords.Common.CallSubNew(Common.java:1061)
at de.hp_mais.cvlib.cvlabel._clabel_click(cvlabel.java:165)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7125)
at android.view.View.performClickInternal(View.java:7102)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27336)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.RuntimeException: java.lang.Exception: Sub getname signature does not match expected signature.
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew(Debug.java:282)
... 32 more
Caused by: java.lang.Exception: Sub getname signature does not match expected signature.
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:321)
... 33 more
I have a riddle to solve here and I hope someone had the same or a similar problem and can tell me.
I have an event routine that is triggered by a custom view (see below) The Custom View has a getName property.
This is queried with a Callsub routine. (Since several views call the same event, the name decides what happens next.)
Now the following happens when an event is triggered in debug mode:
- The subexist routine correctly recognizes the getName property
- if callsub(sender,"getname") is now called, I get an error with the following stack trace (the entire stack trace below).
Caused by: java.lang.RuntimeException: java.lang.Exception:
Sub getname signature does not match expected signature. at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336) at anywheresoftware.b4a.debug.Debug.CallSubNew(Debug.java:282) ...
32 more Caused by: java.lang.Exception:
Sub getname signature does not match expected signature. at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:321) ...
33 more
However, the signature is completely correct, unfortunately it is not that simple.
The error is only thrown in debug mode.
The release mode runs without any problems, as does the debug mode if the event routine is provided with a breakpoint and is debugged.
Likewise, there is no error in the Legacy Debugger.
Of course there are alternatives to my approach without Callsub.
However, I just want to understand what is happening here.
Or is it a bug in deb mode?
I am happy about every hint.
The Event Code:
B4X:
Sub alarmsetup_click
Dim Name As String
If SubExists(Sender,"getname") Then
Name=CallSub(Sender,"getname") ' here is the error line
Else
Return
End If
Select Name
Case "timeinput"
SelMF.OpenForm("show_time_date_select",Null)
Case "closepage"
Close
End Select
End Sub
the complete stacktrace of error message:
Error occurred on line: 103 (EditAndStoreAlarmForm)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug(Common.java:1082)
at de.peter.testlib.editandstorealarmform._alarmsetup_click(editandstorealarmform.java:155)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1114)
at anywheresoftware.b4a.keywords.Common.CallSubNew(Common.java:1061)
at de.hp_mais.cvlib.cvtextlink._lview_click(cvtextlink.java:400)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1114)
at anywheresoftware.b4a.keywords.Common.CallSubNew(Common.java:1061)
at de.hp_mais.cvlib.cvlabel._clabel_click(cvlabel.java:165)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:7125)
at android.view.View.performClickInternal(View.java:7102)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27336)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.RuntimeException: java.lang.Exception: Sub getname signature does not match expected signature.
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:336)
at anywheresoftware.b4a.debug.Debug.CallSubNew(Debug.java:282)
... 32 more
Caused by: java.lang.Exception: Sub getname signature does not match expected signature.
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:321)
... 33 more