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

Lots of nullable-annotated methods don't explain what conditions make them nullable #218

Closed
ZacSweers opened this issue Feb 1, 2017 · 4 comments

Comments

@ZacSweers
Copy link

This is super confusing to develop against as it's sort of guessing what could be causing this.

@EricKuck
Copy link
Member

EricKuck commented Feb 1, 2017

I'd like to get this fixed up ASAP, but I guess I'm not sure how documentation for that typically works. Were you thinking something like this?

    /**
     * Returns the host Activity of this Controller's {@link Router}. Will return null if this 
     * Controller has not yet been attached to an Activity or if the Activity has been destroyed.
     */
    @Nullable
    public final Activity getActivity() {
        return router != null ? router.getActivity() : null;
    }

@ZacSweers
Copy link
Author

Yep that looks reasonable!

@PaulWoitaschek
Copy link
Collaborator

Javadoc would be like

  /**
   * @return the host Activity of this Controller's {@link Router} or {@code null} if this
   * Controller has not yet been attached to an Activity or if the Activity has been destroyed.
   */
  @Nullable
  public final Activity getActivity() {
    return router != null ? router.getActivity() : null;
  }

@EricKuck
Copy link
Member

EricKuck commented Feb 1, 2017

Thanks @PaulWoitaschek! I'll try to knock this out fast for the next release.

PaulWoitaschek pushed a commit to PaulWoitaschek/Conductor that referenced this issue Oct 9, 2017
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

3 participants