Skip to content
Vincent Cantin edited this page Nov 24, 2013 · 6 revisions

#Java language

Basic semantic differences

List of the basic semantic differences used to define a change:

  • {comment, class, [static] class field, [static] method, code block, statement, expression} was {added, removed}.
  • {class, [static] class field, [static] method, local field} was renamed.
  • {comment, class, [static] class field, [static] method, code block, statement, expression} was moved to another place.
  • {comment, code block, expression} was modified (replaced by something else).
  • code block was refactored into a method, and its reverse transformation.
  • logical expression was reformulated.
  • code block was reformulated.
  • {import, spacing} was modified.

Some terms above might be considered as synonym by implementers:

  • renamed, refactored and reformulated are all expressing a different way to alter a java program without modifying its semantic.

Some of those differences are changing the semantic of the program, some are not, our tool need to find out.

Non-unique semantic descriptions for a given change

Some changes can be described using a different set of semantic differences.

For example, let's consider this change:

Before the change After the change
int a = 123; int b = 123;

It could be described as a rename of the variable a to b, or it could be described as the removal of the declaration int a = 123; with the addition of the declaration int b = 123;.

While being both correct, the description with the rename is likely to be considered more acceptable by most of the users. In the general case however, the decision of using a description of a change over another one is something which depends on the user's personal choice. Therefore, while proposing a likely acceptable change description, the semantic diff tool should give the user the option to choose which description is the most suitable in each specific context.

In order to present acceptable default behaviors, the tool will need some heuristics to decide which semantic descriptions are more user friendly and less prone to conflicts during semantic merge operations.

Clone this wiki locally