Skip to content

Adopt the naming convention of the ESEC/FSE 2022 paper#48

Merged
pmbittner merged 11 commits intodevelopfrom
benjamin/renames
Oct 6, 2022
Merged

Adopt the naming convention of the ESEC/FSE 2022 paper#48
pmbittner merged 11 commits intodevelopfrom
benjamin/renames

Conversation

@ibbem
Copy link
Copy Markdown
Collaborator

@ibbem ibbem commented Sep 17, 2022

This is based on #46 to avoid heavy merge conflicts when merging. So this should only be merged after #46.

@pmbittner
Copy link
Copy Markdown
Member

Please use AE instead of BE. In particular, "artifact" instead of "artefact" to be consistent with the paper.

@pmbittner
Copy link
Copy Markdown
Member

Please unflattern the previous "patterns.proposed" package. We would like to keep the "proposed" sub-package.

Comment thread src/main/java/org/variantsync/diffdetective/diff/difftree/DiffNode.java Outdated
Comment thread src/main/java/org/variantsync/diffdetective/diff/difftree/NodeType.java Outdated
Note the American English spelling.
The class EditPattern is renamed to EditClass and is moved to the
preliminary package because there is no use outside of it. Unfortunately
it cannot be removed easily because the preliminary would need many
changes.
I think the meaningfulness of this rename is best explained by the
second sentence of the original class description:
> Contrary to its name, [...]
The root node is now implicitly characterised by having no parents (no
after and no before parent). This makes it consistent with some
representations of `DiffTree`s where the root node is printed as an IF
node with the feature mapping `true`.

All representations which did explicitly mark the root node are now
printing an IF node and do not mark it specially. Most notably is the
line graph representation which did encode `NodeType.ROOT` in the node
ID (this is the reason why many IDs in the test cases changed).

For backwards compatibility the `isAnnotation` function of `DiffNode` is
still returning false on root nodes. This is subject to further
refactoring, mostly necessary to handle the difference between
`DiffGraph`s and actual trees.
Not having an explicit root gives the opportunity for
`isAnnotation() ^ isArtifact()` to hold.

The tests indicate only once place needing change for this to work: The
root node should not print `#endif` after the root node.
`NodeType.ENDIF` was only needed during parsing. Now, there are no more
temporary nodes representing `endif` macros during parsing, instead
endif macros are noticed earlier so no further parsing is performed.

All serialisations using the ordinal of `NodeType.ENDIF` are changed in
a backwards incompatible way. Most notably, the line graph format uses
`DiffNode.getID` which encodes the `NodeType`. (This is the reason why
many test cases changed).
@pmbittner pmbittner added Refactoring documentation Improvements or additions to documentation labels Sep 22, 2022
@ibbem ibbem changed the title [WIP] Adopt the naming convention of the ESEC/FSE 2022 paper Adopt the naming convention of the ESEC/FSE 2022 paper Sep 22, 2022
Given the diff (without modifications)
```diff
 #ifdef A
 Code
 #endif
```

The ID of the root node and the `#ifdef A` node computed the same ID.
For ensuring the uniqueness of the root node ID its line number is set
to `DiffLineNumber.Invalid` (for consistency both start and end are
changed).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants