-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Issue #171 - Fixing Some Lint Warnings #3171
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
Issue #171 - Fixing Some Lint Warnings #3171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add tests to make sure this change works as expected?
@@ -122,7 +123,7 @@ boolean cacheContainsKey(String term) { | |||
Observable<CategoryItem> categoryItemObservable = gpsCategories() | |||
.concatWith(titleCategories(imageTitleList)); | |||
if (hasDirectCategories()) { | |||
categoryItemObservable.concatWith(directCategories().concatWith(recentCategories())); | |||
categoryItemObservable = categoryItemObservable.concatWith(directCategories().concatWith(recentCategories())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one's a bit of logic change. Just wanted to point this one out.
233a48d
to
6acd285
Compare
Fixing conflicts now. |
Fixing Some Android Lint and SonarLint Warnings in these packages: * `fr.free.nrw.commons.bookmarks` * `fr.free.nrw.commons.bookmarks.locations` * `fr.free.nrw.commons.bookmarks.pictures` Some of the fixes were: * Switching the try/catch/finally blocks for database querying into try-with-resources blocks, with the Cursor object getting set as the closable resource * Switching a lot of field types in sqlite "Create Table Statements" from STRING to TEXT * Creating a DAOException and throwing that instead of a generic RuntimeException in a few places * Logging some Exceptions using Timber instead of `e.printStackTrace()` * A few access modifier changes to be more restrictive * Adding a private constructor to some static inner classes
Fixing Some Android Lint and SonarLint Warnings in this package: * `fr.free.nrw.commons.category` Some of the fixes were: * Switching the try/catch/finally blocks for database querying in `CategoryDao` into try-with-resources blocks, with the Cursor object getting set as the closable resource * Switching one field type in the sqlite "Create Table Statement" in CategoryDao from STRING to TEXT * Throwing the new DAOException instead of a generic RuntimeException in CategoryDao * Logging some Exceptions using Timber instead of `e.printStackTrace()` * A few access modifier changes to be more restrictive * Adding a private constructor to some static classes * Made some constant String variables for recurring Strings * Changed the switch cases with only one case into if/else statements * Added some @nonnull and @nullable annotations to methods that inherit methods that use those annotations
…lin Test Files `junit.framework` is deprecated. Replacing it with `org.junit` in 4 Kotlin Test files.
6acd285
to
e4d0d88
Compare
Codecov Report
@@ Coverage Diff @@
## master #3171 +/- ##
=========================================
+ Coverage 6.22% 6.23% +0.01%
=========================================
Files 264 265 +1
Lines 11212 11189 -23
Branches 852 846 -6
=========================================
Hits 698 698
+ Misses 10457 10434 -23
Partials 57 57
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although the merge conflicts are gonna be painful :(
@JasonSarwar Let us know if you are still working on it! |
I am closing the PR for now as it seems like the author isn't working on it anymore, feel free to reopen if needed :) |
Description (required)
Fixes part of #171 Fix Lint errors/warnings
Fixing Some Android Lint and SonarLint Warnings in these packages:
fr.free.nrw.commons.bookmarks
fr.free.nrw.commons.bookmarks.locations
fr.free.nrw.commons.bookmarks.pictures
fr.free.nrw.commons.category
Some of the changes were:
Cursor
object getting set as the closable resourceDAOException
and throwing that instead of a genericRuntimeException
in a few places (SonarLint: RSPEC-112)e.printStackTrace()
(SonarLint: RSPEC-1148)final
to a few variables that are never changed@NonNull
and@Nullable
annotations to methods that inherit methods that use those annotationsjunit.framework
package imports in some Kotlin test classes withorg.junit
because the former is deprecatedTests performed (required)
Ran the Gradle Tests and Tested ProdDebug on the Nexus 6 Emulator with API level 22.
Please let me know if there's anything I should change back or if there's anything I should elaborate on!