Page tree
Skip to end of metadata
Go to start of metadata
Description

When you get warnings related to duplicate class declarations like below, then it means that the same class has been found more than once in the source files.

Analysis log file
2018-10-22 04:06:10.897295    Information    MODULMSG ; Job execution    Parsing Java file (phase 1) : S:\Sources\MYAPP\Analyzed\my_package\WEB-INF\classes\com\mycompany\SomeClass.java  
2018-10-22 04:06:10.899248    Warning    MODULMSG ; Job execution    JAVA068: Duplicate class declaration : com.mycompany.SomeClass S:\Sources\MYAPP\Analyzed\my_package\WEB-INF\classes\com\mycompany\SomeClass.java
Observed in CAST Extension

Release

Yes/No

JEE 1.0.x(tick)
JEE 1.1.x(tick)
JEE 1.2.x(tick)
Observed on RDBMS
RDBMS
Yes/No
Oracle Server(tick)
Microsoft SQL Server(tick)
CSS3(tick)
CSS2(tick)
Step by Step Scenario

Below is the step-by-step scenario leading to the problem:

  1. Package and deliver the application.
  2. Set as current version.
  3. Run the analysis.
  4. Check the analysis log file.
  5. Warnings "JAVA068: Duplicate class declaration"

Impact of the Problem

The impact of the problem on the analysis can be wrong links or missing links, due to wrong resolution.

Example :

  • class A is defined in both files C:\Folder_One\A.java and C:\Folder_Two\A.java
  • class B is defined in both files C:\Folder_One\B.java and C:\Folder_Two\B.java
  • class B has a method bMethod referring to class A.

The analyzer will resolve with the first matching object encountered. The result will be the following :

  • Both methods bMethod will have a link to the same class A (the one defined in folder Folder_One)
  • No link to the second class A (the one defined in folder Folder_Two)

Functionally speaking this is not correct. We should have :

  • Method bMethod from class B defined in folder FolderOne should have a link to class A defined in folder FolderOne
  • Method bMethod from class B defined in folder FolderTwo should have a link to class A defined in folder FolderTwo

This is a limitation of the analyzer.

NOTE

In JEE releases 1.0.20 and 1.2.6-funcrel  onwards, the limitation of  wrong or missing links due to wrong resolution  has been resolved.

Action Plan

To overcome this limitation, the architecture of the application should be studied further. Check

  1. If there is unnecessarily duplicated code, it should be excluded from the application.
  2. If there are several Java applications gathered into this CAST Application : consider splitting them into several applications and redoing the on-boarding.
  3. If the previous steps do not solve the issue, then contact CAST Technical Support, with the Relevant input in order to reproduce the issue
Notes/comments

 Ticket # 14560 , 14341, 17648,  17706

Related Pages


  • No labels