fix null point error

This commit is contained in:
oppofind 2019-12-23 20:39:27 +08:00
parent ec59855850
commit 75b5742973
2 changed files with 5 additions and 5 deletions

View File

@ -1007,7 +1007,7 @@ public class SourceBuilder {
String mockValue = "";
if (DocClassUtil.isPrimitive(simpleTypeName)) {
mockValue = paramsComments.get(paraName);
if(mockValue.contains("|")){
if (Objects.nonNull(mockValue) && mockValue.contains("|")) {
mockValue = mockValue.substring(mockValue.lastIndexOf("|") + 1, mockValue.length());
} else {
mockValue = "";

View File

@ -181,7 +181,7 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate {
String typeName = parameter.getType().getGenericCanonicalName();
String simpleName = parameter.getType().getValue().toLowerCase();
String fullTypeName = parameter.getType().getFullyQualifiedName();
JavaClass javaClass = builder.getClassByName(fullTypeName);
JavaClass javaClass = builder.getJavaProjectBuilder().getClassByName(fullTypeName);
if (!DocClassUtil.isMvcIgnoreParams(typeName)) {
if (!paramTagMap.containsKey(paramName) && DocClassUtil.isPrimitive(fullTypeName) && isStrict) {
throw new RuntimeException("ERROR: Unable to find javadoc @param for actual param \""