-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Return null on GET 404 #1206
Return null on GET 404 #1206
Conversation
@@ -66,6 +66,9 @@ protected BatchAccountImpl wrapModel(String name) { | |||
|
|||
@Override | |||
protected BatchAccountImpl wrapModel(BatchAccountInner inner) { | |||
if (inner == null) { |
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.
might be simpler/cleaner to just say:
return (inner == null) ? inner : new .... ;
@@ -66,6 +66,9 @@ protected BatchAccountImpl wrapModel(String name) { | |||
|
|||
@Override | |||
protected BatchAccountImpl wrapModel(BatchAccountInner inner) { | |||
if (inner == null) { |
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.
might be simpler/cleaner to just say:
return (inner == null) ? null : new .... ;
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 actually find inline conditionals hard to read, particularly in this case the line gets too long with the inline constructor call. Inline conditionals are forbidden in Sun's original checkstyle rules: http://checkstyle.sourceforge.net/config_coding.html#AvoidInlineConditionals but we are not reinforcing it.
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.
ok
Return null on GET 404
…n the NextLink property could not be found (Azure#1206)
Current behavior is throwing
CloudException
. Changed to simply return null. Related PR: Azure/autorest-clientruntime-for-java#123