This is an automated email from the ASF dual-hosted git repository.
yihua pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new 83d4fe15b4f [MINOR] Prevent nullptr exception if enum config class has
extra fields (#8575)
83d4fe15b4f is described below
commit 83d4fe15b4f50a58e919390217b71bb95e952085
Author: Jon Vexler <[email protected]>
AuthorDate: Fri May 5 02:15:30 2023 -0400
[MINOR] Prevent nullptr exception if enum config class has extra fields
(#8575)
This commit fixes the exception if there are additional fields that aren't
enum constants. This should be allowed.
Co-authored-by: Jonathan Vexler <=>
---
.../src/main/java/org/apache/hudi/common/config/ConfigProperty.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/hudi-common/src/main/java/org/apache/hudi/common/config/ConfigProperty.java
b/hudi-common/src/main/java/org/apache/hudi/common/config/ConfigProperty.java
index e871cf03770..d4ed193a041 100644
---
a/hudi-common/src/main/java/org/apache/hudi/common/config/ConfigProperty.java
+++
b/hudi-common/src/main/java/org/apache/hudi/common/config/ConfigProperty.java
@@ -171,7 +171,7 @@ public class ConfigProperty<T> implements Serializable {
Objects.requireNonNull(description);
sb.append(description.value());
for (Field f: e.getFields()) {
- if (isValid(f.getName())) {
+ if (f.isEnumConstant() && isValid(f.getName())) {
EnumFieldDescription fieldDescription =
f.getAnnotation(EnumFieldDescription.class);
Objects.requireNonNull(fieldDescription);
sb.append("\n ");