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: fix non terminating PositionBuilder #3595

Merged
merged 2 commits into from
Sep 15, 2020

Conversation

Strum355
Copy link
Contributor

PositionBuilder would get caught in the < in the annotation string, resulting in o2 == o1 and no advancement being made.
This fix ignores the opening angle bracket if it comes at the start of the search space

@@ -424,6 +426,13 @@ public void testPositionGeneric() throws Exception {
assertEquals("protected static", contentAtPosition(classContent, position3.getModifierSourceStart(), position3.getModifierSourceEnd()));
}

@Test(timeout=10000)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a reason for the timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test specifically tests to make sure PositionBuilder terminates in a reasonable time. The existing bug caused non-termination, therefore if it doesn't terminate in a reasonable time, we assume it to be non-terminating

@monperrus
Copy link
Collaborator

LGTM, all tests are green, will merge.

@monperrus monperrus changed the title fix: PositionBuilder non terminating fix: fix non terminating PositionBuilder Sep 15, 2020
@monperrus monperrus merged commit 82afe57 into INRIA:master Sep 15, 2020
@monperrus
Copy link
Collaborator

Thanks a lot @Strum355

@monperrus monperrus mentioned this pull request Oct 14, 2020
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.

3 participants