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

multiple warnings on the library #1

Closed
AndroidDeveloperLB opened this issue Feb 14, 2014 · 8 comments
Closed

multiple warnings on the library #1

AndroidDeveloperLB opened this issue Feb 14, 2014 · 8 comments

Comments

@AndroidDeveloperLB
Copy link

since this library no longer have a jar file, when adding this code into another project it produces warnings that I usually use in order to help avoiding NPE:

"Potential null pointer access: The variable command may be null ..."

please check them out and see if it's really possible that NPE can be caused, or at least make the code avoid those warnings.

@Stericson
Copy link
Owner

There is a jar file. Look at the release section: https://github.com/Stericson/RootTools/releases

@AndroidDeveloperLB
Copy link
Author

I see. please do check the warnings though:

  • "Implicitly using the default locale is a common source of bugs: Use toLowerCase(Locale) instead"
  • "Redundant null check: The variable path cannot be null at this location"
  • "Resource leak: 'reader' is never closed "
  • unused imports
  • many deprecated methods.

@Stericson
Copy link
Owner

I will look into them.

Also keep in mind the deprecated methods is to be expected as this library works as far back as Android 1.5.

I'll def be looking into the reader issue, all of those should be closed.

@AndroidDeveloperLB
Copy link
Author

also please put the link you've just written on the wiki page here :
https://github.com/Stericson/RootTools/wiki

@AndroidDeveloperLB
Copy link
Author

and thank you for your patience.

@AndroidDeveloperLB
Copy link
Author

about the 1.5 usage, you can do a check on android version, and if it's high enough, use the new version's functions.

@Stericson
Copy link
Owner

Updated the front page.

I'll look into the viability of using reflection to use updated methods.

@AndroidDeveloperLB
Copy link
Author

i think reflection is too hard core for this (in case you use it per function). you can simply use something like this for example

if(VERSION.SDK_INT>=VERSION_CODES.GINGERBREAD)
....

sadly it's from API 4 .

maybe put a global check of android versions, which will only use this method, and put the value using reflection.

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

No branches or pull requests

2 participants