Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Only map nodes of the exact same type #71 #73

Merged
merged 1 commit into from
Mar 20, 2020

Conversation

slarse
Copy link
Collaborator

@slarse slarse commented Mar 20, 2020

Fix #71

This PR fixes the problem of array type references and "normal" type references being matched, which in turn can result in crashes when the merge tree is being built. The reason for this behavior is that 3DM merge has absolutely no notion of correct relationships between parent and child nodes. Thus, if nodes of mismatched type are mapped, then their children may be merged such that whichever type comes out triumphant from the merge suddenly has children of types (or with roles) that it can't actually have. Thus, building the merged spoon tree crashes.

This is a very conservative fix, and forces matches to only be between exactly the same type of node. This may cause issues elsewhere. I'm not sure. Only benchmarks can tell. I do think it is necessary, however, due to 3DM's ignorance of valid and invalid parent-child relationships.

@codecov-io
Copy link

Codecov Report

Merging #73 into master will decrease coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #73      +/-   ##
============================================
- Coverage     79.50%   79.43%   -0.07%     
  Complexity      301      301              
============================================
  Files            27       27              
  Lines          1244     1245       +1     
  Branches        196      197       +1     
============================================
  Hits            989      989              
  Misses          156      156              
- Partials         99      100       +1     
Impacted Files Coverage Δ Complexity Δ
src/main/java/se/kth/spork/spoon/SpoonMapping.java 83.58% <100.00%> (+0.24%) 27.00 <0.00> (+1.00)
src/main/java/se/kth/spork/base3dm/Pcs.java 69.56% <0.00%> (-4.35%) 9.00% <0.00%> (-1.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1092688...b562729. Read the comment docs.

@slarse slarse merged commit f3abf12 into master Mar 20, 2020
@slarse slarse changed the title [fix] Only map nodes of the exact same type #57 [fix] Only map nodes of the exact same type #71 Mar 20, 2020
@slarse slarse deleted the issue/71-fix-array-type-reference-errors branch April 10, 2020 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modifying array type references leads to very strange results
2 participants