Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 6
Registered: ‎07-13-2010
My Device: Pearl
My Carrier: ATT
Accepted Solution

Debugging a library

I have a workspace with the following 3 projects:

Library

Tests

GUI

 

The tests only hit the library.  This is a BB project with the type set to "library"

All my tests seem to be working and hitting the code.  If I debug the tests using JUnit, I can step in to a function in my library,  view my variables and all the normal debugging goodness.

 

I created the GUI and included the library in the Required Projects build path.  

 

The problem I have is trying to debug the library via the GUI on the simulator.  When I debug the application I can find my App easily enough.  Right now it's a single button that makes a simple call into the library.

 

For example, something like:

 

 

FieldChangeListener checkListener = new FieldChangeListener() {
public void fieldChanged(Field field, int context) {

 

FieldChangeListener checkListener = new FieldChangeListener() { public void fieldChanged(Field field, int context) {

LibraryClass lc = new LibraryClass();

Dialog.Alert("Class loaded");

}};

 

If I put a break point on the LibraryClass lc = new LibraryClass() Eclipse will break in on the button press.

 

If I step over this method nothing happens.  The code never advances to the Dialog.Alert() line.

 

If I try to step into the constructor and see what's hanging it up in there, nothing happens.  Eclipse never steps in.

 

At first I thought maybe this was some kind of timing issue where the GUI thread needed to do something and so my library call got lost.  

 

I've tried creating a class that implements Runnable so that I can call a ThreadClass.Run() and have THAT class fire up the library calls.  But it behaves the same.

 

There are no exceptions thrown, it just seems as if it walked off the end of the Earth.

 

Does anyone have any idea or seen anything like this?  Is it a configuration issue on the simulator where it's not including the library? Did I miss something obvious?

 

Thanks 
Nate

Highlighted
New Developer
Posts: 6
Registered: ‎07-13-2010
My Device: Pearl
My Carrier: ATT

Re: Debugging a library

Problem boiled down to compiling against jdk 1.6 and the compiler trying to do a StringBuilder behind the scenes.

 

Changed compilation target to 1.4 and everything worked fine.

 

More info: http://blog.palelocust.com/?p=90