ASSERT-KTH / spork

AST-based structured merge tool for Java, fully Git compatible https://doi.org/10.1109/TSE.2022.3143766
MIT License
49 stars 6 forks source link

Names of anonymous classes cause issues #86

Open slarse opened 4 years ago

slarse commented 4 years ago

The names of anonymous functions are integers, and these are arbitrary. However, Spork treats them as if they have meaning for the anonymous function, which can cause content conflicts on anonymous functions even if there are none.

A quick fix for this is to simply not resolve the names of anonymous functions. The downside of that is that there could end up being multiple anonymous functions in the tree with the same name, and I'm uncertain of what effects that may have.

slarse commented 4 years ago

This may have been fixed by 755b27b, but I'm really not sure

slarse commented 4 years ago

As it turns out, just not resolving the name causes crashes when the type of an anonymous class is matched to any other type reference. So we must resolve the name (but we can fake it).

slarse commented 4 years ago

Lo and behold, this did result in bug #93

Current solution is to resolve names to "0" instead, such that anonymous classes are still identified as anonymous. Fixed in d4a42b43d3507e7dc5370eeb12ff05f2200a99b7