-
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:
- {
comment
,class
,[static] class field
,[static] method
,code block
,statement
,expression
} was {added
,removed
}. - {
class
,[static] class field
,[static] method
,local field
} wasrenamed
. - {
comment
,class
,[static] class field
,[static] method
,code block
,statement
,expression
} wasmoved
to another place. - {
comment
,code block
,expression
} wasmodified
(replaced by something else). -
code block
wasrefactored
into amethod
, and its reverse transformation. -
logical expression
wasreformulated
. -
code block
wasreformulated
. - {
import
,spacing
} wasmodified
.
Some terms above might be considered as synonym by implementers:
-
renamed
,refactored
andreformulated
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.
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.