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

[type:fix][ISSUE #5004] Fix build error apiPath. #5006

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ protected void handleMethod(final Object bean, final Class<?> clazz,
final Method method, final String superPath) {
final RequestMapping requestMapping = AnnotatedElementUtils.findMergedAnnotation(method, RequestMapping.class);
ShenyuSpringMvcClient methodShenyuClient = AnnotatedElementUtils.findMergedAnnotation(method, ShenyuSpringMvcClient.class);
methodShenyuClient = Objects.isNull(methodShenyuClient) ? beanShenyuClient : methodShenyuClient;
ShenyuSpringMvcClient shenyuClient = Objects.isNull(methodShenyuClient) ? beanShenyuClient : methodShenyuClient;
// the result of ReflectionUtils#getUniqueDeclaredMethods contains method such as hashCode, wait, toSting
// add Objects.nonNull(requestMapping) to make sure not register wrong method
if (Objects.nonNull(methodShenyuClient) && Objects.nonNull(requestMapping)) {
final MetaDataRegisterDTO metaData = buildMetaDataDTO(bean, methodShenyuClient,
if (Objects.nonNull(shenyuClient) && Objects.nonNull(requestMapping)) {
final MetaDataRegisterDTO metaData = buildMetaDataDTO(bean, shenyuClient,
buildApiPath(method, superPath, methodShenyuClient), clazz, method);
getPublisher().publishEvent(metaData);
getMetaDataMap().put(method, metaData);
Expand All @@ -197,7 +197,7 @@ protected void handleMethod(final Object bean, final Class<?> clazz,
protected String buildApiPath(final Method method, final String superPath,
@NonNull final ShenyuSpringMvcClient methodShenyuClient) {
String contextPath = getContextPath();
if (StringUtils.isNotBlank(methodShenyuClient.path())) {
if (Objects.nonNull(methodShenyuClient) && StringUtils.isNotBlank(methodShenyuClient.path())) {
return pathJoin(contextPath, superPath, methodShenyuClient.path());
}
final String path = getPathByMethod(method);
Expand Down
Loading