Skip to content

Fix warnings for ImageFileLoader.kt #4786 #4789

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

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

Rishavgupta12345
Copy link
Contributor

@Rishavgupta12345 Rishavgupta12345 commented Feb 4, 2022

Fix warnings for ImageFileLoader.kt Fixes #4786

All warning solved except :- 'DATA: String' is deprecated. Deprecated in Java

because solveing this will require major code changes which is probably not necessary at this point of time

@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #4789 (7684b06) into master (587ff3b) will decrease coverage by 0.14%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4789      +/-   ##
============================================
- Coverage     42.17%   42.03%   -0.15%     
+ Complexity     1888     1878      -10     
============================================
  Files           364      364              
  Lines         15735    15734       -1     
  Branches       1361     1361              
============================================
- Hits           6637     6613      -24     
- Misses         8610     8632      +22     
- Partials        488      489       +1     
Impacted Files Coverage Δ
...tomselector/ui/selector/CustomSelectorViewModel.kt 86.66% <ø> (-0.84%) ⬇️
...mons/customselector/ui/selector/ImageFileLoader.kt 82.00% <0.00%> (ø)
...in/java/fr/free/nrw/commons/data/DBOpenHelper.java 0.00% <0.00%> (-40.91%) ⬇️
.../nrw/commons/category/CategoryContentProvider.java 10.71% <0.00%> (-16.08%) ⬇️
...w/commons/upload/categories/BaseDelegateAdapter.kt 35.29% <0.00%> (-11.77%) ⬇️
...va/fr/free/nrw/commons/category/CategoriesModel.kt 47.05% <0.00%> (-1.97%) ⬇️
.../free/nrw/commons/repository/UploadRepository.java 22.41% <0.00%> (-1.73%) ⬇️
...ns/upload/categories/UploadCategoriesFragment.java 86.95% <0.00%> (-1.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 587ff3b...7684b06. Read the comment docs.

@@ -82,7 +82,7 @@ class ImageFileLoader(val context: Context) : CoroutineScope{


if (file != null && file.exists()) {
if (id != null && name != null && path != null && bucketId != null && bucketName != null) {
if (name != null && path != null && bucketName != null) {
Copy link
Member

Choose a reason for hiding this comment

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

What warning does this fix? Are you sure there are no side effects? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes the warning which shows
Condition 'id != null' is always 'true'
Condition 'bucketId != null' is always 'true'

there is no harm removing them

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

Tested for 2 days, I did not notice any particular bug.

@nicolas-raoul nicolas-raoul merged commit 9c27f85 into commons-app:master Feb 7, 2022
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.

Fix warnings for ImageFileLoader.kt
2 participants