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

[fix] Remove pulsar-broker-common dependency from pulsar-client #17855

Merged
merged 10 commits into from
Sep 30, 2022
Prev Previous commit
Next Next commit
Fix annotation discovery
  • Loading branch information
nicoloboschi committed Sep 29, 2022
commit b5cb5940c9e4921f0fbd55c0e3b3e30aada9414b
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public boolean run(String[] args) throws Exception {

private Annotation getFieldContextAnnotation(Field field) {
for (Annotation annotation : field.getAnnotations()) {
if (annotation.getClass().getCanonicalName()
if (annotation.annotationType().getCanonicalName()
.equals("org.apache.pulsar.common.configuration.FieldContext")) {
return annotation;
}
Expand Down Expand Up @@ -128,11 +128,6 @@ boolean required() {
return (boolean) MethodUtils.invokeMethod(fieldContext, "required");
}

@SneakyThrows
boolean optional() {
return (boolean) MethodUtils.invokeMethod(fieldContext, "optional");
}

@SneakyThrows
boolean deprecated() {
return (boolean) MethodUtils.invokeMethod(fieldContext, "deprecated");
Expand Down Expand Up @@ -214,7 +209,8 @@ protected String generateDocByFieldContext(String className, String type, String
List<Pair<Field, FieldContextWrapper>> requiredFields =
fieldList.stream().filter(p -> p.getValue().required()).collect(Collectors.toList());
List<Pair<Field, FieldContextWrapper>> optionalFields =
fieldList.stream().filter(p -> p.getValue().optional()).collect(Collectors.toList());
fieldList.stream().filter(p -> !p.getValue().required() && !p.getValue().deprecated())
.collect(Collectors.toList());
List<Pair<Field, FieldContextWrapper>> deprecatedFields =
fieldList.stream().filter(p -> p.getValue().deprecated()).collect(Collectors.toList());

Expand Down