-
Notifications
You must be signed in to change notification settings - Fork 103
[INSD-8104] Declare local vars final #788
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
Conversation
a7medev
left a comment
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.
I think also we need to do the same thing to RNInstabugReactnativeModule.setInvocationEvents parameters.
|
@a7med-mahmoud The compiler didn't complain about it, but yes we can better do the same here. |
350f6b1 to
db45929
Compare
Co-authored-by: Ali Abdelfattah <aabdelfattah@instabug.com>
Codecov Report
@@ Coverage Diff @@
## master #788 +/- ##
=======================================
Coverage 89.98% 89.98%
=======================================
Files 23 23
Lines 599 599
Branches 93 93
=======================================
Hits 539 539
Misses 52 52
Partials 8 8 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Description of the change
Problem:
Users face a compile error on Android stating that
local variables accessed from within inner class need to be declared final. This is only encountered on projects with Java version prior to 8.Starting Java 8, this requirement was relaxed to final or effectively final. A variable whose value is never changed after it is initialized is effectively final. Hence, users on Java 8 or higher do not face this issue.
Solution:
Declare these local variables explicitly
finalso that the app builds successfully on different Java versions.Type of change
Related issues
Checklists
Development
Code review