Java code review
Under the Java Code Review set of rules, the WebSphere version migration category contains rules for migrating from WebSphere Application Server Version 5.1, 6.0, 6.1, 7.0, 8.0, and 8.5.5 to Version 8.0, 8.5.5, or 9.0. To learn how to get more information about a rule, see Displaying detailed help.
Quick fixes are available where possible. Rules without quick fixes flag the rule violations so you can evaluate their usage and migrate the code manually.
| Rule Name | Rule Description | Automated Fix |
|---|---|---|
| Check for a behavior change on the ServletResponse default content type |
The default content type for HttpServletResponse has changed from "text/html" to "text/plain" for servlets that do not set the content type. |
No |
| Check for behavior change on URLs containing a plus sign |
This rule flags calls in Java code that create Uniform Resource Locators (URL) that contain a plus ("+") character in the URI that is not part of the query parameters. The plus ("+") is only reserved in the query string portion of the URL. |
No |
| Check for expected behavior on ServletResponse sendRedirect() method |
The WebSphere Application Server implementation of the ServletResponse.sendRedirect() method omits path information until the last slash. With a new custom property this behavior can be corrected. |
No |
| Use leading slash on ServletContext getResource() and getResourceAsStream() requests |
This rule flags calls to the ServletContext.getResource() and ServletContext.getResourceAsStream() methods where it cannot easily be determined if the String value passed on the method contains a leading slash (/) as required by the servlet specification. |
No |
| Do not use activity component features that were removed |
This rule flags the use of the activity component classes and interfaces that were removed in WebSphere Application Server V6.0. |
No |
| Do not use Ant task features that were removed |
This rule flags the use of the Ant task classes and interfaces that were removed in WebSphere Application Server V6.0. |
No |
| Do not use asynchronous bean features that were removed |
This rule flags the use of the asynchronous bean classes and interfaces that were removed in WebSphere Application Server V6.0. |
No |
| Do not use object pool features that were removed |
This rule flags the use of the object pool classes that were removed in WebSphere Application Server V6.0. |
No |
| Do not use RAS features that were removed |
This rule flags the use of the RAS classes and interfaces that were removed in WebSphere Application Server V6.0. |
No |
| Do not use scheduler features that were removed |
This rule flags the use of the scheduler classes and interfaces that were removed in WebSphere Application Server V6.0. |
No |
| Do not use security features that were removed |
This rule flags the use of the security classes and interfaces that were removed in WebSphere Application Server V6.0. |
No |
| Do not use the EarUtils class that was removed |
This rule flags the use of the EarUtils class that was removed in WebSphere Application Server V6.0. |
No |
| Do not use setJMSPriority() method that was removed |
This rule flags the use of the method, setJMSPriority, from the interface, com.ibm.websphere.scheduler.MessageTaskInfo. This method was deprecated in the Websphere Application Server V6.0 release and was replaced by the method getJMSPriority. |
No |
| Do not use user profile features that were removed |
This rule flags the use of the user profile classes and interfaces that were removed in WebSphere Application Server V6.0. |
No |
| Rule Name | Rule Description | Automated Fix |
|---|---|---|
| Check for behavior change on EJBContext.setRollbackOnly() method |
A call to setRollbackOnly under a certain scenario can yield a different result on WebSphere Application Server releases prior to V6.0.2. |
No |
| Do not use Common Connector Framework features that were removed |
This rule flags the use of the Common Connector Framework API packages that were removed in WebSphere Application Server V6.1. |
No |
| Do not use the WebSphere Ant StopServer.setHost() method that was removed |
This rule flags the use of the removed method setHost(String s) in the com.ibm.websphere.ant.tasks.StopServer class. |
No |
| Use the open source JDOM implementation instead of the removed implementation |
This rule flags the use of the JDOM packages that were removed in WebSphere Application Server V6.1. |
No |
| Use the open source Mozilla Rhino implementation instead of the removed implementation |
This rule flags the use of the Rhino packages that were removed in WebSphere Application Server V6.1. |
No |
| Use the UserRegistry interface instead of the CustomRegistry interface |
This rule flags the use of the CustomRegistry interface that was removed in WebSphere Application Server V6.1. |
No |
| Rule Name | Rule Description | Automated Fix |
|---|---|---|
| Check for a behavior change in JAX-WS dynamic port memory requirements |
This rule flags the use of JAX-WS dynamic ports that are created using the javax.xml.ws.Service addPort method. This behavior change can increase memory requirements. |
No |
| Check the JAXB context factory initialization class |
This rule flags the JAXBContext newInstance() method because the context factory method has changed since earlier versions of JAXB. |
No |
| Only use JAX-WS annotations in Java EE 5 or later |
This rule detects the use of JAX-WS annotations in enterprise projects earlier than Java EE 5. |
No |
| Do not use the DistributedLockingMap interface that was removed |
This rule flags the removed com.ibm.websphere.cache.DistributedLockingMap interface. |
No |
| Do not use the InvalidationEvent or ChangeEvent constructors that were removed |
This rule flags the use of the removed constructors in the classes com.ibm.websphere.cache.InvalidationEvent or com.ibm.websphere.cache.ChangeEvent. The new constructor takes an additional field. |
No |
| Do not use the SequeLinkDataStoreHelper class that was removed |
This rule flags the use of the com.ibm.websphere.rsadapter.SequeLinkDataStoreHelper class. |
No |
| Do not use the WebSphere UserTransactionWrapper class that was removed |
Do not use the com.ibm.websphere.servlet.session. UserTransactionWrapper class because it has been removed. Store a UserTransaction directly into the HTTP session without wrapping it in the removed class. |
No |
| Do not use the WSConnectJDBCDataStoreHelper class that was removed |
This rule flags the use of the com.ibm.websphere.rsadapter.WSConnectJDBCDataStoreHelper class and the com.ibm.websphere.rsadapter.DataStoreHelper.WSCONNECTJDBC_HELPER field that were removed. |
No |
| Do not use web services gateway customization APIs that were removed |
Do not use web services Customization APIs. The rule flags the use of the com.ibm.wsgw.beans.* package. |
No |
| Use Java EE servlet filters instead of WebSphere Servlet filter class that were removed |
Do not use com.ibm.websphere.servlet.filter classes because they were removed. Use javax.servlet.filter classes instead. |
No |
| Use the ConnectJDBCDataStoreHelper class instead of DataDirectDataStoreHelper class |
Do not use the com.ibm.websphere.rsadapter.DataDirectDataStoreHelper object because it was removed. The quick fix changes the code to use com.ibm.websphere.rsadapter.ConnectJDBCDataStoreHelper instead. |
No |
| Use MicrosoftSQLServerDataStore helper class instead of the MSSQLDataStoreHelper class |
Do not use the com.ibm.websphere.rsadapter.MSSQLDataStoreHelper class because it was removed. The quick fix changes the code to use com.ibm.websphere.rsadapter.MicrosoftSQLServerDataStoreHelper instead. |
No |
| Rule Name | Rule Description | Automated Fix |
|---|---|---|
| Check for a behavior change for EJB presence in a web module |
This rule flags EJB annotations in Java files if these files are in a web module with version 2.5 or higher. |
No |
| Check for a behavior change in ApplicationException inheritance |
This rule flags the EJB ApplicationException annotation which does not have the attribute inherited set. The inherited attribute was added in EJB 3.1 and changed default behavior of EJB 3.0 applications. |
No |
| Check for a behavior change in SOAP Action set on outbound messages |
This rule flags JAX-WS Dispatch client applications that may experience a behavior change in the SOAP Action setting on outbound messages. |
No |
| Check for a behavior change in SOAPMessage methods |
This rule flags calls to the SOAPMessage methods getSOAPHeader() and getSOAPBody() that now throw an exception rather than returning null if the respective header or body is not present. |
No |
| Check for a behavior change in web services SOAP fault codes and strings |
This rule flags applications that retrieves JAX-WS and JAX-RPC SOAP fault codes and strings because some of the content changed in Version 8.0. |
No |
| Check for a behavior change on EntityManager refresh(Object entity) method |
This rule flags the EntityManager.refresh() method because the behavior of this method has changed. |
No |
| Check for a behavior change on OpenJPAEntityManager detach(T pc) method |
This rule flags the OpenJPAEntityManager detach(T pc) method. The method return type changed to support the 2.0 JPA specification. The quick fix changes the detach() method to detachCopy(). |
No |
| Check for a behavior change on SipFactory methods |
This rule flags certain SipFactory methods using a String to, from, or addr parameter for which there is a behavior change. |
No |
| Check for a behavior change on some Server MBean operations |
This rule flags the use of changed Server MBean operations getComponentVersion, getEFixVersion, getPTFVersion, getExtensionVersion, getVersionsForAllComponents, and getVersionsForAllEFixesstartTransports. |
No |
| Check for a behavior change on the SIP URI clone method |
This rule flags the SIP URI clone method because it might throw an exception if the application was compiled with WebSphere Application Server V7.0 or with SIP Servlets 1.0 interfaces. To resolve the exception, recompile the application with WebSphere Application Server V7.0 and the CEA feature pack or with WebSphere Application Server V8.0 and later. |
No |
| Do not use the removed Apache SOAP API |
This rule flags the use of the removed classes in the org.apache.soap and com.ibm.soap packages. |
No |
| Do not use the removed method getCause() from ServletErrorReport |
This rule flags the removed getCause() method in the com.ibm.websphere.servlet.error. ServletErrorReport class. |
No |
| Use the Oracle 11g helper instead of earlier versions |
This rule flags the use of the Oracle 10g helpers and fields. Version 8.0 only supports the Oracle 11g JDBC driver and helper. The quick fix changes the code to use the Oracle 11g helper after confirming that the runtime configuration was changed. |
No |
| Rule Name | Rule Description | Automated Fix |
|---|---|---|
| Check for a behavior change in Java Server Faces (JSF) Applications |
This rule flags Java Server Faces (JSF) applications because the default implementation for JSF container has changed in WebSphere V8.0. |
No |
| Rule Name | Rule Description | Automated Fix |
|---|---|---|
| The Apache HTTP client API was removed |
This rule flags the use of the Apache HTTP client API that was removed in WebSphere Application Server V8.0, V8.5, and V9.0. |
No |
| Rule Name | Rule Description | Automated Fix |
|---|---|---|
| Check for a behavior change in JPA cascade strategy |
This rule flags projects using JPA entity relationships that use cascade types PERSIST, MERGE, or ALL because there is a potential behavior change in WebSphere Application Server V8.5. There is a corresponding XML rule to detect this behavior change. |
No |
| Rule Name | Rule Description | Automated Fix |
|---|---|---|
| SCA was removed |
This rule flags the use of Service Component Architecture (SCA) in applications. SCA was removed in WebSphere Application Server V9.0. |
No |
| The CDI OpenWebBeans API was removed |
This rule flags the use of the Apache OpenWebBeans API that was removed in WebSphere Application Server V9.0. |
No |
| The CEA system application commsvc.ear was removed |
This rule flags use of the Communications Enabled Applications (CEA) REST interface that was provided by the CEA system application commsvc.ear. The commsvc.ear system application was removed in WebSphere Application Server V9.0. |
No |
| The Common Event Infrastructure API was removed |
This rule flags the use of packages from the Common Event Infrastructure API that was removed. |
No |
| The JSF SunRI engine was removed |
This rule flags references to the com.sun.faces package. |
No |