AVK: How to initialize Context
Hi All,
I have a question regarding the result of code-scan process in AVK.
I got my code migrated by AVK and got commented on some part, which is necessary to be executed, could anybody please tell me the reason or give a reference regarding this issue.
The code snippet:
privatevoid setupConnection()throws NamingException{
boolean resetSecurityManager =false;
if (System.getSecurityManager() ==null){
System.setSecurityManager(new RMISecurityManager());
resetSecurityManager =true;
}
try{
String hostname = (String)props.get("hostname");
String port = (String)props.get("port");
Properties env =new Properties();
String url ="rmi://" + hostname +":" + port;
env.put(javax.naming.Context.PROVIDER_URL, url);
env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.rmi.registry.RegistryContextFactory");
Context ctx =new InitialContext(
*//Commented by tool : start*
*/*env*/*
*//Commented by tool : end*
);
kms = (RemoteKMS)ctx.lookup(RemoteKMS.RMI_NAME);
}catch (ServiceUnavailableException e){
throw (e);
}finally{
if (resetSecurityManager)
System.setSecurityManager(null);
}
}
}
Thanks,
Julius

