Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools

Handling Incomplete Programs

Since version 2.6.3 JTransformer creates PEFs even if a project contains Java compilation errors because of unresolved imports. Being able to analyse and transform source code with missing dependencies is especially usefull when only parts of a large project are available to the user or analysis of complete projects would be too time consuming because of their size.

Turning Error-Tolerant Fact Creation On/Off

Error-tolerant fact creation is turned on by default. To turn it off for a particular JTransformer project right click on the project, select “Properties” from the context menu and then select “JTransformer”. Here you must first enable project-specific settings and then (de)select “Ignore unresolved dependencies”.

Handling Unresolved Java elements

When ignoring of unresolved dependencies is turned on and JTransformer encounters an unresolvable reference it:

  1. lets Eclipse report the respective compilation error
  2. creates nevertheless the fact containing the unresolvable reference.
  3. replaces the reference in the fact by a unary function term unresolved(name).

Its name argument is the unresolvable name, as demonstrated by the following example:

Source with unresolvable names Generated PEFs viewed in the Factbase Inspector

Because the com.nothere.* package cannot be resolved, Eclipse adds an error marker at the import command and at each place where the NotHere class from the unresolved package is referenced. Although not illustated in the above screenshot, note that in spite of the error marker attached to the Java project in the Package Explorer the JT icon remains green, signaling that the fact creation has completed succesfully.

The FBI view of the generated facts shows that unresolvable names com.nothere.* and NotHere have been replaced by the dummy IDs unresolved('com.nothere.*') and unresolved('NotHere').

research/jtransformer/tutorial_old/error_tolerance.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024