BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-06-2007, 07:14 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2006
Model: 8700c
Carrier: Cingular
Posts: 32
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default trouble with float/double array

Please Login to Remove!

I'm having trouble trying to create an array of float or double. I'm using JDE 4.1.0.185. What happens is when I set a breakpoint any time after this array declaration has executed, the debugger freezes. Not sure if this is something I'm doing wrong, or if it's an issue with the JDE itself...??

Strange thing is, when I change the array to any form of an int or long, it's fine. But with float or double, the debugger chokes. I can also use a float or double variable, it's just the array that causes a problem. Tried using strictfp (long shot, but don't know what else to try), that didn't fix it.

Here's the code:

Code:
public class myClass {
// any of these variations cause the problem
private double [] C = new double [4];
private double [][] C = new double [4][4];
private float [] C = new float [4];
private float [][] C = new float [4][4];

// this is fine:
private int [][] C = new int [4][4];

TIA

Last edited by kvon : 08-06-2007 at 07:57 PM. Reason: expanded code sample
Offline  
Old 08-06-2007, 10:03 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've never experienced this myself, but if you're really having problems you could just move to the Objects insteand of primitives
ex: private Double[] C = new Double[4];
Offline  
Old 08-06-2007, 07:45 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2006
Model: 8700c
Carrier: Cingular
Posts: 32
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by bemshaswing View Post
...you could just move to the Objects insteand of primitives
ex: private Double[] C = new Double[4];
This sounded like a fantastically simple idea at first blush - as in "why didn't I think of this". It may only serve as a workaround for me though - I'm doing an algorithm that's fairly heavy on the number crunching (matrix determinants), and it makes the code pretty ugly to have to do lots of math using "variable.doubleValue()". It may also prove to be a bottleneck in processing time.

At any rate, thanks for the temporary fix, but I'd sure like to know why this throws the debugger for a loop. Starting to think more & more it's RIMs JDE that's the problem.

Last edited by kvon : 08-06-2007 at 07:46 PM. Reason: clarity
Offline  
Old 08-07-2007, 09:09 AM   #4 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

$ to donuts it's the JDE. Try downloading 4.2.1 and working through there. If that works and you specifically need to build using the 4.1.0.185, just have both share the same workspace. This way you can work and debug using the 4.2.1, then build your deployments with the 4.1.x
Offline  
Old 08-09-2007, 10:05 AM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2006
Model: 8700c
Carrier: Cingular
Posts: 32
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, I DO need to build using 4.1.0 (that's another sore point - for a different message thread), so trying 4.2.1 sounds like a good idea, if not maybe a little painful. Gives me a couple of other ideas too - I'll try debugging on the device, see if that makes a difference. Also, I've never shopped around other 3rd party debuggers, still fairly new to BB development - can anyone recommend a couple of the good ones? It might be time to upgrade...

Thanks!
Offline  
Old 08-19-2007, 05:50 PM   #6 (permalink)
Talking BlackBerry Encyclopedia
 
Skipper_Joe's Avatar
 
Join Date: Jan 2007
Location: Kharkov, Ukraine
Model: 8300
Carrier: N/A
Posts: 237
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

just an idea:
maybe you define rapc property "MicroEdition-Configuration: CLDC-1.0" instead of "MicroEdition-Configuration: CLDC-1.1"?
CLDC1.0 doesn't support float/double types.
Offline  
Old 08-29-2007, 12:18 PM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Sep 2006
Model: 8700c
Carrier: Cingular
Posts: 32
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Skipper_Joe View Post
just an idea:
maybe you define rapc property "MicroEdition-Configuration: CLDC-1.0" instead of "MicroEdition-Configuration: CLDC-1.1"?
CLDC1.0 doesn't support float/double types.
The thing that's funny about this is that the problem specifically is with the debugger, not the code. The code runs just fine, including the float or double calculations. It's just when I try to use the (RIM JDE) debugger to "watch" the double values -- everything freezes up. Tried debugging on the device too, same result.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.