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 getReference and getDeclaration for local type #888

Merged
merged 4 commits into from
Oct 10, 2016

Conversation

danglotb
Copy link
Member

update the test case.

@@ -74,7 +74,8 @@ public void accept(CtVisitor visitor) {
// validating that the parent of a finding is parent of this
// reference as well
for (final CtLocalVariable<T> lv : localVariables) {
if (hasParent(lv.getParent())) {
// Since the getReference() is setting the LocalVariable as parent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment?

final CtLocalVariableReference localVarRefCloned = localVarCloned.getReference();

assertEquals(localVarRef.getDeclaration(), localVar);
assertTrue(localVarRef.getDeclaration() == localVar);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use assertSame

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.

4 participants