Wednesday, March 21, 2007

Bug in PersistenceDemo code of Sun's J2ME book

I'd downloaded the sources of the book "Wireless J2ME Platform Programming" to save some typing. commandAction() method of PersistenceDemo class (Chapter 7) has this bug - it returns after it sees that the event didn't happen on the list, without giving any chance to the exit code that follows. I put a if (c == exit) line right at that start and that does it.

It also looks like that some of the imports aren't needed.

1 comment:

Anonymous said...

People should read this.