You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "TulanCN (via GitHub)" <gi...@apache.org> on 2023/05/09 02:52:56 UTC

[GitHub] [shenyu] TulanCN opened a new issue, #4622: [Question] The document of ‘code-suggestions’ is confusing

TulanCN opened a new issue, #4622:
URL: https://github.com/apache/shenyu/issues/4622

   ### Question
   
   When I read the document of ‘code-suggestions’ , I found that some examples are confusing.
   Such as:
   current : `return null == a.getB() ? null : a.getB().getC();`
   recommendation : `return Optional.ofNullable(a.getB()).map(C::getD).orElse(null);`
   current : `return null == a ? new B() : C.newD(a);`
   recommendation : `return Optional.ofNullable(a).map(B::newC).orElse(new D());`
   
   The code marked with the current and the code marked with the recommendation do not seem to match exactly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shenyu] TulanCN closed issue #4622: [Question] The document of ‘code-suggestions’ is confusing

Posted by "TulanCN (via GitHub)" <gi...@apache.org>.
TulanCN closed issue #4622: [Question] The document of ‘code-suggestions’ is confusing
URL: https://github.com/apache/shenyu/issues/4622


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shenyu] TulanCN commented on issue #4622: [Question] The document of ‘code-suggestions’ is confusing

Posted by "TulanCN (via GitHub)" <gi...@apache.org>.
TulanCN commented on issue #4622:
URL: https://github.com/apache/shenyu/issues/4622#issuecomment-1539614106

   
   Sorry, I thought the document was also in this code repository (just like Spring Cloud Gateway), so I created an issue here, but now I realize that the document is in another code repository
   
   And I have try to fix it.
   current : `return null == a.getB() ? null : a.getB().getC();`
   recommendation :`Optional.ofNullable(a.getB()).map(B::getC).orElse(null);`
   current:`return null == a ? new B() : C.newD(a);`
   recommendation : `return Optional.ofNullable(a).map(B::new).orElse(C.newD(a));`
   
   I found these issues after a brief glance, maybe we need to recheck the [document](https://shenyu.apache.org/community/code-suggestions/#several-methods-to-judge-and-handle-null)?
   And I am willing to make some contributions to this project.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shenyu] yu199195 commented on issue #4622: [Question] The document of ‘code-suggestions’ is confusing

Posted by "yu199195 (via GitHub)" <gi...@apache.org>.
yu199195 commented on issue #4622:
URL: https://github.com/apache/shenyu/issues/4622#issuecomment-1539320375

   Hi, If you have found that you can fix it, follow the code-suggestions .
   > The code marked with the current and the code marked with the recommendation do not seem to match exactly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shenyu] yu199195 commented on issue #4622: [Question] The document of ‘code-suggestions’ is confusing

Posted by "yu199195 (via GitHub)" <gi...@apache.org>.
yu199195 commented on issue #4622:
URL: https://github.com/apache/shenyu/issues/4622#issuecomment-1539730530

   Hi,  Do you think there is something wrong with the documentation?   If so, you can fix it here : https://github.com/apache/shenyu-website
   
   
   >current : return null == a.getB() ? null : a.getB().getC();
   recommendation :Optional.ofNullable(a.getB()).map(B::getC).orElse(null);
   current:return null == a ? new B() : C.newD(a);
   recommendation : return Optional.ofNullable(a).map(B::new).orElse(C.newD(a));


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org