JBoss Java code review rules
Under the Java code review set of rules, the JBoss to WebSphere code migration category contains multiple rules. To learn how to get more information about a rule, see Displaying detailed help.
| Rule Name | Rule Description | Automated Fix |
|---|---|---|
| Do not use JBoss-specific naming lookup strings | This rule detects the use of JBoss Application Server naming lookup strings that start with "java:", such as "java:jboss" and "java:jdbc". Strings that start with "java:" or "java:/" are also detected because the content afterwards might contain JBoss Application Server values. | No |
| Do not use JBoss-specific packages | This rule detects imported classes that begin with org.jboss. These classes must be manually migrated. | No |
| Do not use JBoss-specific send or receive timeout constants | This rule detects JBoss Application Server connection and response timeout constants such as org.jboss.ws.timeout. | No |
| Do not use JBoss-specific string literals | This rule detects general JBoss Application Server strings that are not covered by other rules. | No |
| Do not use MBeans for JBoss application startup or shutdown logic |
This rule detects classes that implement the MBean registration interface to run application startup and shutdown logic. The quick fix that is provided for this rule converts the class to implement the ServletContextListener interface to perform startup and shutdown logic. Important: If your code provides MBeans and it implements MBeanRegistration for its
intended purpose, you should turn off this rule.
|
No |
| Migrate MBeans specific to other application servers |
This rule detects all invocations of the javax.management.ObjectName constructor that might be application-server specific and would need to be migrated for the application to run on WebSphere Application Server. |
No |
| Use portable JNDI property values | This rule detects the use of the constructor, javax.naming.InitialContext(Hashtable), specifying not to put any proprietary JBoss Application Server JNDI name values into the hash table. | No |
| Do not use JBoss-specific JNDI property values |
This WebSphere Application Server traditional rule detects the use of these JNDI property values:
If these values are found, an option is provided to change the JNDI names to default portable JNDI name values:
Restriction:
The JNDI name values must be in the same Java source file where the context
is initialized with the
javax.naming. InitialContext(Hashtable)
constructor.
|
No |
| Do not use JBoss-specific send or receive timeout constants | This WebSphere Application Server traditional rule detects JBoss JAX-RPC and JAX-WS timeout constants to be migrated to IBM web service timeout constants. | No |
| JBoss packages and classes are not supported in WebSphere |
This rule detects the use of JBoss string literals in Java code and property files. All string literals that include "jboss" are flagged. Use packages, classes, and properties provided by Java EE or WebSphere Application Server instead. |
No |
| Validate the result of concatenation with getRealPath("") |
In WebSphere traditional, getRealPath("") returns a String that ends in a trailing slash. Check that concatenation with this method does not add an extra slash. |
No |
| Validate the result of concatenation with getRealPath("*/") |
In Liberty and WebSphere traditional, getRealPath("*/") returns a String that ends in a trailing slash. Check that concatenation with this method does not add an extra slash. |
No |