Make inner public classes static?

E Erik Hellman 3 years 7 months ago
2 1 0

Hi!
 
The EMDK API have several inner classes that are passed to callbacks. For instance, com.symbol.emdk.barcode.ScanDataCollection.ScanData when scanning barcodes.
 
The problem is that this class is an inner non-static class, which means it needs a parent instance in order to be instantiated. This makes writing unit tests difficult as well risk leaking memory as it retains a referens to the containing instance. I suggest that you make all inner classes static wherever possible, at least when they are public.
 
Thanks!
 
// Erik

Please Register or Login to post a reply

1 Replies

E Efkan YILMAZ

Thanks for the feedback Erik, I'll raise with the EMDK team.

Out of interest, which test framework(s) are you using?  We haven't seen many questions on automated testing with our devices which I think is a bit surprising.

CONTACT
Can’t find what you’re looking for?