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

Updated RateOrShareFragment elements to disappear on some config options. #553

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nkotixwolf
Copy link
Collaborator

No description provided.

)
)
)
return
Copy link
Owner

Choose a reason for hiding this comment

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

I prefer having no random returns within methods. In both cases you're calling dialog?.setTitle() with a string parameter. Have the if/else statement set that string parameter appropriately, and call dialog?.setTitle(thatStringParameter) at the end of the method.

)
return
}
catch (e: Exception) {
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of catching an Exception and then re-throwing "if it's an NPE" later, why not just catch only NullPointerException and let any other kind of exception get automatically not caught and thrown?


fun isCustomException(e: Exception) {
when (e) {
is NullPointerException -> {
Copy link
Owner

Choose a reason for hiding this comment

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

To complement the previous comment - basically you've caught any exception and then have logic to check whether it's an NPE and re-throw if it's not. It's significantly simpler to just catch only the NPE instead.

Comment on lines +285 to +287
catch (NullPointerException e) {
throw e;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Why are you catching the NPE and then just throwing it? Why not just not catch it in the first place?

Comment on lines +301 to +303
catch (NullPointerException e) {
throw e;
}
Copy link
Owner

Choose a reason for hiding this comment

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

Same here, why catch at all?

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.

2 participants