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

Suspicious calculation of sourceEnd in JDTTreeBuilderHelper#createTypeAccessNoClasspath #813

Closed
msteinbeck opened this issue Sep 1, 2016 · 0 comments

Comments

@msteinbeck
Copy link
Contributor

In JDTTreeBuilderHelper#createTypeAccessNoClasspath the following code is used to calculate sourceEnd:

int sourceEnd = (int) (positions[qualifiedNameReference.indexOfFirstFieldBinding - 1] >>> 32) - 2;

I'm wondering why you don't use:

int sourceEnd = qualifiedNameReference.sourceEnd();

instead? I have a case in which qualifiedNameReference.indexOfFirstFieldBinding is 0 and, therefore, an ArrayIndexOutOfBoundsException is thrown.

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

No branches or pull requests

1 participant