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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
