Closed tobias-rnh closed 3 months ago
This time the unit tests for windows fail but they run on my machine.
The CodeQuality checks checkstyle_new
and pmd
seem to also not be working now, however the error messages seem to not be related to my changes.
3 things to do before merge:
StatementBlock
) now have equals
methods but no corresponding hash
methods. Those would need to be added.EqualsModProperty
interface like equalsModRemaning
that call equalsModProperty
with the corresponding property.Attention: Patch coverage is 41.42012%
with 99 lines
in your changes missing coverage. Please review.
Project coverage is 38.09%. Comparing base (
a4de274
) to head (dd8d2ef
). Report is 5 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
3 things to do before merge:
1. Fix merge conflicts.
Done.
2. Some Classes (e.g., `StatementBlock`) now have `equals` methods but no corresponding `hash` methods. Those would need to be added.
Most of the time, this was a false alert. The hashCode() method is not directly overridden, but the method computeHashCode() that does the actual computation in hashCode() is overridden. For some classes, however, I have added implementations of computeHashCode().
3. Add default methods to `EqualsModProperty` interface like `equalsModRemaning` that call `equalsModProperty` with the corresponding property.
As discussed, we do not add default methods. Most of the properties like TermLabelsProperty are only defined for terms, and there are no comparable properties defined for other instances of the generic type T.
I have changed equalsModThisProperty in RenamingSourceElementProperty to use the general navigation structure instead of the TreeWalker. Because of this, I have removed the TreeWalker entirely. This PR could now be merged after all the tests have passed.
Intended Change
Building on top of #3386, the interface
EqualsModProperty
has now been changed so that it can be used not just withTerm
s but theoretically any class if a properProperty
is implemented. The signature of the method has also been slightly modified so that it is able to handle equality checks that utilize additional parameters (like was the case withequalsModRenaming
defined onSourceElement
s that is also refactored with this PR).To refactorThe new general navigation structure is used to move through the tree of SourceElements.equalsModRenaming
ofSourceElement
, a new InterfaceTreeWalker
and implementing classJavaASTTreeWalker
have been introduced that make it possible to move through the tree of SourceElements step by step.Plan
Direct tests for JavaASTTreeWalker (currently only indirectly tested through tests for equalsModProperty)Even more doc commentsType of pull request
Ensuring quality
Additional information and contact(s)
EqualsModProperty
The old
TermEqualsModProperty
has now been parameterized with a type
T
so that it can accommodate other classes than justTerm
:equalsModProperty
is furthermore parameterized with a typeV
that can account for additional parameters needed for the equality check.Properties
is now parameterized with a type
T
so that it can accommodate other classes than justTerm
:equalsModThisProperty
is furthermore parameterized with a typeV
that can account for additional parameters needed for the equality check.Refactoring of equalsModRenaming
As
equals
andequalsModRenaming
for SourceElements were basically doing the same thing except for a few classes (equals
mostly calledequalsModRenaming
), the idea was that the content ofequalsModRenaming
is moved toequals
entirely. The special cases that did not callequalsModRenaming
inequals
or made use of theNameAbstractionTable
are now handled by aJavaASTTreeWalker
.The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.