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

Return null on GET 404 #1206

Merged
merged 1 commit into from
Oct 19, 2016
Merged

Return null on GET 404 #1206

merged 1 commit into from
Oct 19, 2016

Conversation

jianghaolu
Copy link
Contributor

@jianghaolu jianghaolu commented Oct 19, 2016

Current behavior is throwing CloudException. Changed to simply return null. Related PR: Azure/autorest-clientruntime-for-java#123

@@ -66,6 +66,9 @@ protected BatchAccountImpl wrapModel(String name) {

@Override
protected BatchAccountImpl wrapModel(BatchAccountInner inner) {
if (inner == null) {

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) {

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 .... ;

Copy link
Contributor Author

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.

Choose a reason for hiding this comment

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

ok

@martinsawicki martinsawicki merged commit 7aaba7b into Azure:master Oct 19, 2016
jianghaolu pushed a commit to jianghaolu/azure-sdk-for-java that referenced this pull request Feb 27, 2017
sima-zhu pushed a commit to sima-zhu/azure-sdk-for-java that referenced this pull request Mar 21, 2019
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.

3 participants