tencentyun / tsf-simple-demo

Tencent Service Framework Demo
85 stars 70 forks source link

Swagger扫描报错 #4

Closed raylax closed 4 years ago

raylax commented 4 years ago

TsfSwaggerAutoConfiguration中

    private static Function<Class<?>, Boolean> handlerPackage(final String basePackage) {
        return (input) -> {
            if (StringUtils.isEmpty(basePackage)) {
                return false;
            } else {
                String[] packages = basePackage.trim().split(",");
                String[] var3 = packages;
                int var4 = packages.length;

                for(int var5 = 0; var5 < var4; ++var5) {
                    String strPackage = var3[var5];
                    if (input != null) {
                        // 这里
                        boolean isMatch = input.getPackage().getName().startsWith(strPackage);
                        if (isMatch) {
                            return true;
                        }
                    }
                }

                return false;
            }
        };
    }

如果inputjavassist生成的input.getPackage().getName()会报空指针