-
-
Notifications
You must be signed in to change notification settings - Fork 136
Cleanup of warnings / possible not checked nullpointers #1610
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
Cleanup of warnings / possible not checked nullpointers #1610
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign the CLA at https://www.nativescript.org/cla. |
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
if (!isKotlinClass) { | ||
return new JavaClassDescriptor(javaClass); | ||
} | ||
return new JavaClassDescriptor(javaClass); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
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.
The if
statement seems unnecessary as we return some lines above in the case of Kotlin originating bytecode and the only case we will reach this point is when we're dealing with Java originating bytecode
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.
The IDE complained that the if statement is always false.
Which is correct, its never set to true and then reached.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -61,7 +62,7 @@ private static void writeInt(int value, StreamWriter out) throws Exception { | |||
private static void writeMethodInfo(MethodInfo mi, | |||
HashMap<String, Integer> uniqueStrings, StreamWriter outValueStream) | |||
throws Exception { | |||
int pos = uniqueStrings.get(mi.name).intValue(); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
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.
It should be autounboxed by the JVM, and this is also a build time step. I believe this change is ok.
if (!isKotlinClass) { | ||
return new JavaClassDescriptor(javaClass); | ||
} | ||
return new JavaClassDescriptor(javaClass); |
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.
The if
statement seems unnecessary as we return some lines above in the case of Kotlin originating bytecode and the only case we will reach this point is when we're dealing with Java originating bytecode
@@ -61,7 +62,7 @@ private static void writeInt(int value, StreamWriter out) throws Exception { | |||
private static void writeMethodInfo(MethodInfo mi, | |||
HashMap<String, Integer> uniqueStrings, StreamWriter outValueStream) | |||
throws Exception { | |||
int pos = uniqueStrings.get(mi.name).intValue(); |
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.
It should be autounboxed by the JVM, and this is also a build time step. I believe this change is ok.
ff0c7ec
to
c2c7932
Compare
readded .intValue() unboxing, to be very clear that we want to have here int not Integer |
@saschaarthur there is no difference in this case. If the |
* chore:Update CHANGELOG for v6.5.0 * Make buildMetadata aware of whitelist/blacklist files (#1590) * - warning cleanups (#1610) * Bump to 6.5.1 * Update CHANGELOG.md for 6.5.1 * Hardcode first emulator * Use wait-for-device Co-authored-by: Martin Bektchiev <[email protected]> Co-authored-by: saschaarthur <[email protected]>
Description
Exception handling / code cleanup
Does your commit message include the wording below to reference a specific issue in this repo?
There was plenty of warnings by my IDE (IntelliJ).
Most of the stuff was because of failing null pointer checks and unreachable/unused code / as well not needed function calls.
Logic is 100% the same.
Does your pull request have unit tests?
Everything fixed here should be covered by already existing unit tests