catching errors using orb, nameService and Binding lists..
could you please let me know which are the most checks that i can do in the following code...
//create and initialize the ORB
ORB orb = ORB.init(argv,null);
//creates an object for the client's Servant and
//initializes it with the orb.
ServantClient theCallbackObjectRef =new ServantClient();
if (theCallbackObjectRef ==null){
System.out.println ("theCallbackObjectRef = null");
return;
}
//call orb and connect the object reference for the client's servant
orb.connect(theCallbackObjectRef);
// get the root naming context
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
if (objRef ==null){
System.out.println("nameService ObjRef = null");
return;
}
//narrow the objRef to NamingContext Ref
NamingContext ncRef = NamingContextHelper.narrow(objRef);
if (ncRef ==null){
System.out.println("NamingContext ncRef = null");
return;
}
//List all bindings in the naming context.
//The list method lists the bindings in the naming context. 100 bindings from the initial
//naming context will be returned in the BindingListHolder;
//any remaining bindings are returned in the BindingIteratorHolder.
BindingListHolder bl =new BindingListHolder();
BindingIteratorHolder blIt=new BindingIteratorHolder();
ncRef.list(100, bl, blIt);
//tale the array
Binding bindings[] = bl.value;
i searched a lot on the net and i couldn't find many many checks... many people dont even check if the objects are null or so..
have i missed some catches?
is there any site that explains can you check for run time errors on your code?
e.g. if you take string ...check if it is null before you print it or use it or sth like that..

