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

[2398 byte] By [Juliusa] at [2007-10-2 10:44:01]
# 1

Are you saying that code-scan task commented your code? Then that's a bug. code-scan task is not supposed to change your code.

Can you check if your code got commented by code-scan task or translate-dd task? Even if translate-dd commented your Java code, then I would consider that to be a bug.

Any case, will you be able to send us a test case? Send it to J2EE_AVK_support@sun.com . Please mention which version of AVK you are using.

Thanks,

Sahoo

sahoo_ska at 2007-7-13 2:54:18 > top of Java-index,Enterprise & Remote Computing,AVK Portability...
# 2
Hi Sahoo,The code got commented in code-scan phase, and i'm using JAVKE 1.4.1.Btw, i've sent an email to J2EE_AVK_support@sun.com regarding the test case.Regards,Julius
Juliusa at 2007-7-13 2:54:18 > top of Java-index,Enterprise & Remote Computing,AVK Portability...