Skip to content

Commit 517f719

Browse files
committed
fix
1 parent 46115dc commit 517f719

File tree

1 file changed

+7
-7
lines changed
  • fluss-client/src/main/java/org/apache/fluss/client/converter

1 file changed

+7
-7
lines changed

fluss-client/src/main/java/org/apache/fluss/client/converter/PojoType.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ static <T> PojoType<T> of(Class<T> pojoClass) {
8585
if (!publicField) {
8686
// When not a public field, require both getter and setter
8787
if (getter == null || setter == null) {
88-
if (field.getName().startsWith("this$")) {
89-
final Class type = field.getType();
90-
if ((type.getName() + "$" + pojoClass.getSimpleName())
91-
.equals(pojoClass.getName())) {
92-
continue;
93-
}
94-
}
9588
final String capitalizedName = capitalize(name);
9689
throw new IllegalArgumentException(
9790
String.format(
@@ -151,6 +144,13 @@ private static Map<String, Field> discoverAllInstanceFields(Class<?> clazz) {
151144
if (Modifier.isStatic(mod) || Modifier.isTransient(mod)) {
152145
continue;
153146
}
147+
// Skip references to enclosing class
148+
if (f.getName().startsWith("this$")) {
149+
final Class type = f.getType();
150+
if ((type.getName() + "$" + clazz.getSimpleName()).equals(clazz.getName())) {
151+
continue;
152+
}
153+
}
154154
f.setAccessible(true);
155155
fields.putIfAbsent(f.getName(), f);
156156
}

0 commit comments

Comments
 (0)