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 bug: NPE when compilation units array contains null elements #928

Merged
merged 1 commit into from
Nov 3, 2016

Conversation

sjd78
Copy link
Contributor

@sjd78 sjd78 commented Nov 3, 2016

Fix a bug in TreeBuilderCompiler.buildUnits() where a retured array is
longer then expected and the extra spaces are null. The method is updated
to use the totalUnits instance variable as the true element count in
the unitsToProcess array instead of the length of the array itself.

This broke processing of classes using JDTBatchCompiler.getUnits() and
expecting every element in the array to be non-null. The problem came up
when trying to process the source for a large GWT project.

This applies the fix for issue #550 to master.

Fix a bug in TreeBuilderCompiler.buildUnits() where a retured array is
longer then expected and the extra spaces are null. The method is updated
to use the _totalUnits_ instance variable as the true element count in
the _unitsToProcess_ array instead of the length of the array itself.

This broke processing of classes using JDTBatchCompiler.getUnits() and
expecting every element in the array to be non-null.  The problem came up
when trying to process the source for a large GWT project.
@monperrus
Copy link
Collaborator

I see that #550 was merged in stable. And this was never ported to master?

@sjd78
Copy link
Contributor Author

sjd78 commented Nov 3, 2016

Correct. I happened to come back to my project using spoon and hit the error again. Reapplied the PR and things started working again.

I just checked the code in the current stable branch and I don't see the change their either.

@monperrus monperrus merged commit 40eae7f into INRIA:master Nov 3, 2016
@monperrus
Copy link
Collaborator

sorry for that. we have a bug in the process to be fixed.

@sjd78
Copy link
Contributor Author

sjd78 commented Nov 3, 2016

No problem. Thanks for the quick merge!

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.

2 participants