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

Add @Nullable annotations where necessary. #185

Merged
merged 1 commit into from
May 15, 2018
Merged

Conversation

hackbar
Copy link
Contributor

@hackbar hackbar commented May 15, 2018

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

@@ -76,7 +78,7 @@ public ImageRequest(
int maxHeight,
ScaleType scaleType,
Config decodeConfig,
Response.ErrorListener errorListener) {
@Nullable Response.ErrorListener errorListener) {
Copy link
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
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
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