Skip to content

Add @Nullable annotations where necessary.#185

Merged
jpd236 merged 1 commit intogoogle:masterfrom
hackbar:master
May 15, 2018
Merged

Add @Nullable annotations where necessary.#185
jpd236 merged 1 commit intogoogle:masterfrom
hackbar:master

Conversation

@hackbar
Copy link
Copy Markdown
Contributor

@hackbar hackbar commented May 15, 2018

The docstring and code already behave like these params can be null.

ScaleType scaleType,
Config decodeConfig,
Response.ErrorListener errorListener) {
@Nullable Response.ErrorListener errorListener) {
Copy link
Copy Markdown
Collaborator

@jpd236 jpd236 May 15, 2018

Choose a reason for hiding this comment

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

should the listener arg be @nullable too? (here and throughout)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The current API is listener cannot be null in the constructor (according to the docstring), but the member variable mListener can be set to null by cancel(). So the member is annotated, but the constructor arg is not.

Copy link
Copy Markdown
Collaborator

@jpd236 jpd236 left a comment

Choose a reason for hiding this comment

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

Build failed due to:

The following files are not formatted properly:
/home/travis/build/google/volley/src/main/java/com/android/volley/toolbox/JsonRequest.java
/home/travis/build/google/volley/src/main/java/com/android/volley/toolbox/StringRequest.java
/home/travis/build/google/volley/src/main/java/com/android/volley/toolbox/JsonArrayRequest.java

mind running ./gradlew googleJavaFormat and uploading a new commit to resolve this?

(see also https://github.com/google/volley/blob/master/CONTRIBUTING.md)

The docstring and code already behave like these params can be null.
@jpd236 jpd236 merged commit a0f4d39 into google:master May 15, 2018
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