-
Notifications
You must be signed in to change notification settings - Fork 1
Semantic
#Java language
List of the basic semantic differences used to define a change:
- {
class
,[static] class field
,[static] method
,block of code
,statement
} was {added
,removed
}. - {
class
,[static] class field
,[static] method
,local field
} wasrenamed
. - {
class
,[static] class field
,[static] method
,block of code
, statement} wasmoved
to another place. -
block of code
wasmodified
(replaced by something else). -
block of code
is refactored (modified
) into amethod
, and its reverse transformation.
Some of those differences are changing the semantic of the program, some are not, our tool need to find out.
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.