Use portable JNDI property values

This rule flags any usage of the javax.naming.InitialContext(Hashtable) constructor since it cannot always determine the runtime values in the Hashtable. When using the javax.naming.InitialContext(Hashtable) constructor, ensure that no proprietary JNDI property values are used. JBoss proprietary JNDI property values include:

If these JNDI property values are not used, then no additional action is necessary. If these JNDI property values are used then there are three possible manual solutions.

Option 1: Use the javax.naming.InitialContext() constructor

Use this option if there are no other JNDI properties are getting set. This option is valid for WebSphere Application Server traditional or Liberty.

Option 2: Remove the naming factory and naming provider properties from the Hashtable.

Use this option if other JNDI properties are getting set. This option is valid for WebSphere Application Server traditional or Liberty.

Option 3: Replace JNDI property values with valid WebSphere Application Server traditional JNDI property values

This option is valid for WebSphere Application Server traditional:

If the literal string values for these JNDI property values are found in the same Java source file where the javax.naming.InitialContext(Hashtable) constructor is used, then use the Do not use JBoss-specific JNDI property values WebSphere Application Server traditional rule.