-
-
Notifications
You must be signed in to change notification settings - Fork 352
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(equal): regenerate EqualVisitor based on new Scanner, which fixes a number of bugs incl. #978 #993
Conversation
biScan(annotationFieldAccess.getTypeCasts(), other.getTypeCasts()); | ||
biScan(annotationFieldAccess.getTarget(), other.getTarget()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont need the target?
@@ -18,243 +18,275 @@ | |||
|
|||
package spoon.support.visitor.clone; | |||
|
|||
import java.lang.annotation.Annotation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you disable the autoImport in order to see the important change?
try { | ||
assertThat(actual) | ||
.isEqualTo(expected); | ||
} catch (AssertionError e) { | ||
throw new ComparisonFailure("ReplacementVisitor different", expected.toString(), actual.toString()); | ||
//throw new ComparisonFailure("ReplacementVisitor different", expected.toString(), actual.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please had at least a logger
done. mergeable from my point of view, so as to proceed with the next ones. |
public class EqualsVisitor extends spoon.reflect.visitor.CtAbstractBiScanner { | ||
public static boolean equals(spoon.reflect.declaration.CtElement element, spoon.reflect.declaration.CtElement other) { | ||
return !(new spoon.support.visitor.equals.EqualsVisitor().biScan(element, other)); | ||
public class EqualsVisitor extends CtBiScannerDefault { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is now manually maintained?
Yes. However, it will eventually only contain one |
CtTry var = factory.Code().createCodeSnippetStatement("try{}catch(RuntimeException | AssertionError e){}").compile(); | ||
CtTry var2 = var.clone(); | ||
var2.getCatchers().get(0).getParameter().getMultiTypes().remove(0); | ||
assertNotEquals(1, var.getComments().size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is not related to comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, fixed
… a number of bugs incl. INRIA#978
Thank you! |
closes #978