Posts

Showing posts from 2008

Pair Programming Know - how

This is a very good start for knowing the ABCs of pair programming. http://www.wikihow.com/Pair-Program Believe me, it helps. i experienced it a lots. It takes you to the solution quickly. It also gets your code to look cleaner and better. Of course, you will end up writing the best possible code.

Autoboxing & Null Pointers

By this time, you should all be used to the java 5 concepts and most of you might be using them in your development. There are few naunces to the auto boxing, which we should be handling carefully. One fine day, in a flow, suddenly i get a NPE. Looking through the logs, i was astonished to find where it occurred. Long userId = args.getParameter("UserId"); int resultCount = updateAllUserInfo(userId, userVO); -- The line where NPE occured. For an instance, i was wondering, how will NPE occur without us doing any object related operations! Have a look at the updateAllUserInfo() method signature below. private updateAllUserInfo(long userId, UserVO userVO){ . . } The user id i pass to the method is a Long object, but the method takes in the primitive long. With the tiger, java takes care of converting an object to primitive value & hence the exception. interesting finding for the day! Powered by ScribeFire .