I've tried myself to compile in aid to Tommaso.
As I've seen all tries he made this days (I've worked with assembly for a lot of years), so I supposed the problem was inside the code (and the translation of Java).
Interesting point, I've debugged as I made in the past when I have no debugger & no aid: delete one module at a times: after that, I discover it needs only a function to give me the stack overflow condition.
The offender code is:
"Else If" (nested)
I think Java haven't a similar keyword, so in my mind the interpretation java of this code is a classical:
if condition then
step1
else
if condition2 then
step2
... and so on.
So, in one piece of B4A code I've seen almost hundreds of "Else if"nested (perfectly valid in Basic environment and nice to look at, even if in this case should be better a "select case").
As B4A you have correctly nested in java, but, as javac compiles the nested code the stack overflows.
EDITED: After a while I try to deep more...
In release mode else if was traduced with "else if" this:
//BA.debugLineNum = 1561;BA.debugLine="If Name = \"NumOrd\" Then";
if ((_name).equals("NumOrd")) {
//BA.debugLineNum = 1563;BA.debugLine="NumOrd = Function.CIntMia(Text.ToString)";
_numord = _function._cintmia /*int*/ (getActivityBA(),(Object)(_text.ToString()));
}else if((_name).equals("ListBase")) {
//BA.debugLineNum = 1565;BA.debugLine="ListBase = Function.CStrMia(Text.ToString)";
_listbase = _function._cstrmia /*String*/ (getActivityBA(),(Object)(_text.ToString()));
}else if(
and so on...
In debug mode instead B4A works with else and curly brakets (in debug maybe the need is different, sure
@Erel made this for a good reason).
RDebugUtils.currentLine=11010050;
//BA.debugLineNum = 11010050;BA.debugLine="If Name = \"NumOrd\" Then";
if ((_name).equals("NumOrd")) {
RDebugUtils.currentLine=11010052;
//BA.debugLineNum = 11010052;BA.debugLine="NumOrd = Function.CIntMia(Text.ToString)";
__ref._numord /*int*/ = _function._cintmia /*int*/ (getActivityBA(),(Object)(_text.ToString()));
}else
{RDebugUtils.currentLine=11010053;
//BA.debugLineNum = 11010053;BA.debugLine="Else If Name = \"ListBase\" Then";
if ((_name).equals("ListBase")) {
RDebugUtils.currentLine=11010054;
//BA.debugLineNum = 11010054;BA.debugLine="ListBase = Function.CStrMia(Text.ToString)";
__ref._listbase /*String*/ = _function._cstrmia /*String*/ (getActivityBA(),(Object)(_text.ToString()));
}else
The parser seems recursively call a function every "if then else".
The error give the idea (the parser works compiling this if - then - else - if - then - else... like a unique single statement, leaving to the stack the task to manage the entire code-jumping. The mistery of StackOverflow is now solved...
...
com.sun.tools.javac.parser.JavacParser.parseSimpleStatement(JavacParser.java:2519)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatement(JavacParser.java:2431)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatements(JavacParser.java:2370)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.block(JavacParser.java:2340)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.block(JavacParser.java:2354)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseSimpleStatement(JavacParser.java:2511)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatement(JavacParser.java:2431)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseStatementAsBlock(JavacParser.java:2395)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.parseSimpleStatement(JavacParser.java:2519)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatement(JavacParser.java:2431)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.blockStatements(JavacParser.java:2370)
at jdk.compiler/com.sun.tools.javac.parser.JavacParser.block(JavacParser.java:2340)
@Erel, don't know if you can put some arrangement / warning during the basic2java interpretation or if you want to investigate anymore, but if someone try to nest a lot of "Else If" the error is "Stack Overflow" during compilation, so it's very difficult to discover why for the poor programmer.
Thank you however for your support for this fantastic program, I hope with this post to aid someone in future having similar problems.
And sorry for my "spaghetti" English, as usual.
Maurizio