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 compiler and lint warnings #53

Merged
merged 9 commits into from
Feb 11, 2014
Merged

Conversation

choefele
Copy link
Contributor

As discussed in #52, I fixed the compiler and build warnings.

Most commits are straight-forward. The changes to PointQuadTree and PolyUtil are covered by unit tests.

Notes:

  • As mentioned by you, the usage of the deprecated class Point is intentional, so I suppressed the warning
  • Handler leaks: the reference to the outer class creates a cyclic reference as long as the instance is alive. However, since instances of these classes are short-lived, it doesn't create a memory leak. For this reason, I disabled the warning instead of refactoring the class.

Please have a look, thanks.

mChildren.add(new PointQuadTree<T>(mBounds.minX, mBounds.midX, mBounds.minY, mBounds.midY, mDepth + 1));
mChildren.add(new PointQuadTree<T>(mBounds.midX, mBounds.maxX, mBounds.minY, mBounds.midY, mDepth + 1));
mChildren.add(new PointQuadTree<T>(mBounds.minX, mBounds.midX, mBounds.midY, mBounds.maxY, mDepth + 1));
mChildren.add(new PointQuadTree<T>(mBounds.midX, mBounds.maxX, mBounds.midY, mBounds.maxY, mDepth + 1));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not convinced this adds very much :)

I think we should at least set the size to 4.

Could you also indent the lines above with spaces instead of tabs?

@choefele
Copy link
Contributor Author

I updated PointQuadTree to use spaces instead of tabs

@choefele
Copy link
Contributor Author

Yes, agree that ArrayList doesn't add much, but there doesn't seem to be a way to initialize an array of objects that have a generic parameter. Alternative would have been to suppress warning, which I think is worse.

@broady
Copy link
Contributor

broady commented Feb 11, 2014

Thank you for all of your contributions!

I forgot to ask - have you signed the Google CLA?

@choefele
Copy link
Contributor Author

I submitted the request, but haven't received any confirmation (if there is any)

@broady
Copy link
Contributor

broady commented Feb 11, 2014

I don't think there's a confirmation - so, thanks!

broady added a commit that referenced this pull request Feb 11, 2014
Fix compiler and lint warnings
@broady broady merged commit 7af9e8c into googlemaps:master Feb 11, 2014
@choefele choefele deleted the fix-warnings branch February 12, 2014 19:27
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