10-18-2010 06:13 AM
Okay for quite a few days now I have been struggling with a monumental problem. It seemed that whenever I had one of the classes I was using in an app, the blasted thing would not load onto the simulator, (still havent tried on a device, aiming for a 8100). What it would do is load and run the most previous working version of the app and no code changes were refected on the simulator. After much trail and error I managed (i hope) to track down the error to a couple of lines of code.
These lines were
private double vLatitude = 0;
private double vLongitude = 0;
When I comment out both but not either of these two lines in a cut down version of the class, containing only the instance variables and the corresponding EditField declarations, it works and loads and runs correctly. Changing the code a few times over in the trail and error approach, the following DO NOT work.
private double vLatitude = 0; // Unmentioned error
private double vLongitude = 0;
private double vLatitude = 0.0; // Unmentioned error
private double vLongitude = 0.0;
private double vLatitude = 0.0d; // Verification error 2522
private double vLongitude = 0.0d;
private float vLatitude = 0; // Verification error 2522
private float vLongitude = 0;
private float vLatitude = 0.0f; // Verification error 2522
private float vLongitude = 0.0f;
However changing them both to String does work, and I'm sure I can build a workaround in the app because I dont need to do any math with them. Its a bit confusing that these lines of code would make the app act so strangely. I have a few int s in there aswell and they seem to work just dandy (so far).
Does anyone know further details about this problem and if there is a solution (not a workaround), is this some hidden and unexplained phenomenon of the Java language or supernatural.
Will update if I find anything else out.
Eclipse BB plugin
10-18-2010 02:21 PM
Do you think it would be possible to see some of your code? If you have other instance variables and these are simpily amoung them then I don't understand where the errors would come from. See where they are might make it easier.
11-04-2010 04:06 AM
Its been a while, didnt know anyone had responded to this.
Anyway I've come accross what I suspect is the same problem elsewhere in my application
double uploaded = 0;
double percent = 0;
Two primitive doubles initialised on declaration except this time these are local variables in a toString() method, so I think this should go straight to the top of Blackberry Developers food chain. Is there some kind of colossal feck up in the JVM MicroEdition version 4.5 Library that mucks up double declarations.
11-04-2010 11:36 AM
I'm not following, so you have these variable as local variables (in toString) and class variables and... it doesn't preverify? Did I get that correct?
11-05-2010 07:49 AM
The doubles that were instance variables are unrelated to the doubles that are local variables. Ive managed to overcome the problem by not having any doubles in my code, the problem i dont think is anything to do with my code AT ALL, if anyone else has had some spooky goings on with primitive doubles i wanted to see if i could see the pattern. but i doubt it, i am sure that it is an issue with the JVM - JRE. How to you elavate it to the attension of blackberry employees???
11-05-2010 08:11 AM
you can post bugs at the JIRA bugtracker:
11-05-2010 10:11 AM
Not sure if this article is related to issue you are facing, but interesting read nonetheless:
You may also want to check to make sure the build target OS version and your Simulator's OS version don't clash.