BUG 10 or more case statements in a sub within a class causes invalid code execution

RadCoder

Member
Licensed User
Longtime User
In one of my classes I have a JobDone sub which I just recently expanded to 14 case selects for handling http callbacks. As soon as I added the other case statements after successful compile runtime was executing code which could not have been called. After scratching my head for an hour, I decided to comment out the new case statement and everything returned to normal. In order to support the new callback jobs, I figured it was a problem with the java code generation and select case statement, so I changed all my select cases in that class to if else if and the problem went away. I was able to reproduce the error on several android versions 2.34 and 4.04.

b4a version is 222 with the latest http 1.22 lib correcting the bug I found, not sure if its related.

Also not sure if the case select limit is actually 10 or lower/higher but its around there, don't have enough time to continue testing it. if else if works as expected

The class handling the http callback was instantiated by a service, if that helps

Erel please confirm
thanks
Rad
 

RadCoder

Member
Licensed User
Longtime User
No sorry can't post the code, i haven't tried this but to replicate but this is what I have

Create a class which uses httputil2
Create a custom service
Have the service instantiate the class
In jobdone within the class Add 20 case statements for HTTP callbacks
Run the project

It will compile fine , runtime blows up

Also my project is large 20 classes 2 services 5000 lines of code approx
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…