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

Some DRY issues in subclasses of ILastLocationFinder #1

Open
GoogleCodeExporter opened this issue Dec 16, 2015 · 0 comments
Open

Some DRY issues in subclasses of ILastLocationFinder #1

GoogleCodeExporter opened this issue Dec 16, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

1. The subtle differences in (the upper half of) getLastBestLocation() between 
GingerbreadLastLocationFinder and LegacyLastLocationFinder doesn't make sense 
to me. The code in GingerbreadLastLocationFinder looks correct.

2. The constructor GingerbreadLastLocationFinder() sets accuracy to 
ACCURACY_LOW but the comment above is about ACCURACY_COARSE (which is used in 
LegacyLastLocationFinder).

I suggest one of the following refactorings:
- Rename ILastLocationFinder to LastLocationFinder and turn it into an abstract 
class with common code, or
- Remove ILastLocationFinder, rename LegacyLastLocationFinder to 
LastLocationFinder, put the common code there and make 
GingerbreadLastLocationFinder extend that class.

While you're at it, you may also remove the redundant parenthesis in:
        if ((time > minTime && accuracy < bestAccuracy)) {

Oh, and thanks for an awesome deep dive! Helped me a lot.

Original issue reported on code.google.com by [email protected] on 26 Jun 2011 at 9:44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant