On this page:
- Extension ID
- Description
- What's new?
- Technology support
- Function Point, Quality and Sizing support
- CAST AIP compatibility
- Supported DBMS servers
- Prerequisites
- Dependencies with other extensions
- Download and installation instructions
- Application qualification information
- Prepare and deliver the source code
- Analysis configuration and execution
- What analysis results can you expect?
- Current known limitations
Target audience:
Users of the extension providing JEE analysis support.
Summary: This document provides information about the extension providing JEE analysis support.
Extension ID
com.castsoftware.jee
Description
This extension provides support for JEE.
What's new?
Please see the following pages for information about new features/changes, fixed bugs, changes that will impact results etc.:
Technology support
Language / Framework | Supported | Supported Versions | |
---|---|---|---|
Java JDK |
| ||
Presentation layer frameworks | Java Server Faces (JSF) |
This includes the support of the following third-party JSF libraries:
| |
JSP |
Note:
| ||
Apache Struts |
| ||
Struts Validator |
| ||
STXX |
| ||
Persistence layer frameworks | Hibernate |
| |
JPA |
| ||
EJB |
| ||
Other frameworks | Spring IoC |
| |
WSDL |
| ||
CDI |
| ||
Spring Batch | - | ||
Project Lombok | Lombok |
|
Java 9 support
Private Methods in Interface
From Java 9 onward, users can write private methods in interfaces using the private access modifier as shown in following sample of code. These methods are now supported by the JEE Analyzer:
public interface DBLogging { String MONGO_DB_NAME = "ABC_Mongo_Datastore"; String NEO4J_DB_NAME = "ABC_Neo4J_Datastore"; String CASSANDRA_DB_NAME = "ABC_Cassandra_Datastore"; default void logInfo(String message) { log(message, "INFO"); } default void logWarn(String message) { log(message, "WARN"); } default void logError(String message) { log(message, "ERROR"); } default void logFatal(String message) { log(message, "FATAL"); } private void log(String message, String msgPrefix) { // Step 1: Connect to DataStore // Step 2: Log Message with Prefix and styles etc. // Step 3: Close the DataStore connection } // Any other abstract, static, default methods }
Module concept
- Starting with Java 9, new concepts of modules are introduced directly in-between packages and class loaders. It encapsulates packages and the classes there in.
- A specific module-info.java is used for module declaration and a new syntax has been introduced for this purpose.
Java 10 support
Local-Variable Type Inference (JEP 286)
Java 10 extends type inference to declarations of local variables with initializers and introduces the use of 'var' for the purpose of local-variable type inference. This makes local variable definitions clear and concise. See the examples below.
/* before Java 10, the type of the local variables were to be specified explicitly */ ArrayList<String> list = new ArrayList<>(); for( Iterator<String> iter=list.iterator() ; iter.hasNext() ; ) { // do something here } for ( String ele : list ) { int len = ele.length(); }
/* Since java 10, local variable type inferenence is implicit from the initialization expression */ var list = new ArrayList<String>(); for( var iter=list.iterator() ; iter.hasNext() ; ) { // iter infers type from its assigned value } for ( var ele : list ) { // 'ele' is resolved to the enclosed type of the iterable (String here) var len = ele.length(); }
Enlighten will also display the resolved types as seen below
Java 11 support
Local-Variable Syntax for Lambda Parameters (JEP 323)
This JEP will allow "var" to be used when declaring the formal parameters of implicitly typed lambda expressions. This aligns the syntax of lambdas with Java 10's local-variable type inference. Instead of writing this:
(x, y) -> x.process(y)
We’ll be able to write this in Java 11:
(var x, var y) -> x.process(y)
Annotations can also be applied to the lambda formal parameters:
(@CustomAnnot var m, var n) -> m.processUDT(n)
Enlighten's code viewer will display the resolution of var for lambdas. A sample is shown below:
The new APIs introduced in Java 11 will also be resolved in Enlighten. For example, here are some of the new String APIs:
Analysis configuration for Java JDK 9 - 13
By default, AIP Console/CAST Management Studio will not specifically offer JDK 9 - 13 options in the Java Version configurations setting (see JEE - Analysis configuration). Instead, the CAST will assume that that latest version of the JDK has been used to compile the application source code - and in this case, "Latest" includes support for Java 9 - 13.
- Function Points (transactions): a green tick indicates that OMG Function Point counting and Transaction Risk Index are supported
- Quality and Sizing: a green tick indicates that CAST can measure size and that a minimum set of Quality Rules exist
Function Points (transactions) | Quality and Sizing |
---|---|
CAST AIP release | Supported |
---|---|
8.3.x | |
8.2.x | |
8.1.x | |
8.0.x | |
7.3.x |
Supported DBMS servers
This extension is compatible with the following DBMS servers:
DBMS servers | Supported |
---|---|
CSS/PostgreSQL | |
Oracle | |
Microsoft |
Prerequisites
An installation of any compatible release of CAST AIP (see table above) |
Required third-party software
The following section lists any third-party software that may be required to successfully deliver source code and run an analysis with the JEE Analyzer extension:
Install on workstation running DMT | Install on workstation running CMS |
---|---|
Nothing required The CAST Delivery Manager Tool (DMT) only requires the location of the JEE application for extraction and packaging. | Nothing required |
Dependencies with other extensions
Some CAST AIP extensions require the presence of other CAST AIP extensions in order to function correctly. The JEE Analyzer extension requires that the following other CAST AIP extensions are also installed:
- Web services linker service (internal technical extension)
Download and installation instructions
Please see:
Application qualification information
Please see: JEE - Application qualification specifics
Prepare and deliver the source code
Please see: JEE - Prepare and deliver the source code
Analysis configuration and execution
Please see: JEE - Analysis configuration and execution and all child pages:
- JEE - Analysis configuration
- JEE - Analysis of pure Java applications
- JEE - Framework analysis tips
- JEE - Handling action classes
- JEE - Environment Profiles
- JEE - Advanced customization of a JEE analysis
- JEE - Run and validate analysis
What analysis results can you expect?
Please see: JEE - Analysis results
Structural rules
The vast majority of rules provided for the JEE Analyzer are embedded in CAST AIP - see JEE - Structural rules for more information. In addition, some rules are also provided with the extension:
Current known limitations
See also JEE Analyzer - Technology support notes.
Quality Rules
Avoid static field of type collection (7562)
When calculating a snapshot for applicationusing JSE 5.0, the Quality Rule "Avoid static field of type collection (7562)" does not list as "Very High Risk Objects" classes that are or inherit from a Generic collection. The Quality Rule lists only the non generic form of collections. For example static attributes of type java.util.Collection<E> will not be reported as a violation.
Persistence: Avoid table and column names that are too long (portability) (7706)
Situation:
- JEE application using the Java Persistence API (JPA), e.g. in the form of Hibernate.
- A table or column name is not specified in the annotations of the JPA entity.
Symptoms: The JPA entity is not listed as a "Very High Risk" object in the results.
No link bookmarks generated
When Java Methods are defined inside a JSP file, no link bookmarks are generated (bookmarks can be seen in CAST Enlighten or in the Dynamic Link Manager). Example of a Java Method defined in a JSP file:
<%@ page language="Java" %> <%! public void myMethod(String message) { System.out.println(message); } %>