Windows UWP port, arrays and collections

11 views
Skip to first unread message

mcw

unread,
Mar 9, 2017, 5:31:30 PM3/9/17
to CodenameOne Discussions
I finally figured out the issue with my app on UWP. I know there have been a lot of issues with arrays and collections in the past, things we shouldn't do. Here is the code that is causing problems:

vector.addElement(new String(string));

As far as I can tell there is no exception thrown, I have Log.bindCrashProtection(true); and don't get any notifications. By adding logging around the statement it just seems to die and never returns.

The above code runs fine on Android, iOS and the simulator

Now that I know where the issue is I can easily work around it. Is this code suspect or should it work?

Thanks

Shai Almog

unread,
Mar 10, 2017, 1:35:12 AM3/10/17
to CodenameOne Discussions
I don't see anything wrong with that.
Can you try using add and maybe switch to the new collections e.g. ArrayList?
Maybe there is a deadlock with the synchronized old collections or something like that.

mcell...@gmail.com

unread,
Mar 10, 2017, 6:15:44 AM3/10/17
to CodenameOne Discussions
I found some issues when it came to creating new strings if the string was empty on UWP - it was throwing an exception whos name escapes me but it was a CLI verification exception or something like that

So if in the riginal posters example the variable string was an empty string it would complain

ie

String str = "";

Vector v = new Vector();

c.addElement(new String(str)); //doesn't like when str is an empty string
c.addElement("");                   //code doesn't seem to mind this

Paul

Steve Hannah

unread,
Mar 10, 2017, 1:12:25 PM3/10/17
to codenameone...@googlegroups.com
Thanks.  This is now fixed in git, and will be included with the next server update.

Steve

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/f8063527-61ef-4f0b-8ac2-23ad1098db88%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Software Developer
Codename One
Reply all
Reply to author
Forward
0 new messages