[
https://issues.apache.org/jira/browse/FLINK-6909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16285997#comment-16285997
]
ASF GitHub Bot commented on FLINK-6909:
---------------------------------------
Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/5097#discussion_r156090203
--- Diff:
flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java
---
@@ -1822,13 +1828,15 @@ private static Type
materializeTypeVariable(ArrayList<Type> typeHierarchy, TypeV
* OR
* - there are getter and setter methods for the field.
*
+ * Returns a message why the given field is not valid. Otherwise an
empty option for valid fields.
+ *
* @param f field to check
* @param clazz class of field
* @param typeHierarchy type hierarchy for materializing generic types
*/
- private boolean isValidPojoField(Field f, Class<?> clazz,
ArrayList<Type> typeHierarchy) {
- if(Modifier.isPublic(f.getModifiers())) {
- return true;
+ private static Optional<String> analyzePojoField(Field f, Class<?>
clazz, ArrayList<Type> typeHierarchy) {
--- End diff --
Shouldn't this be an `Either` to be in line with other methods in this
class. An Optional that actually contains something in case of failure seems a
bit strange.
> Flink should support Lombok POJO
> --------------------------------
>
> Key: FLINK-6909
> URL: https://issues.apache.org/jira/browse/FLINK-6909
> Project: Flink
> Issue Type: Wish
> Components: Type Serialization System
> Reporter: Md Kamaruzzaman
> Assignee: Timo Walther
> Priority: Minor
>
> Project lombok helps greatly to reduce boilerplate Java Code.
> It seems that Flink does not accept a lombok POJO as a valid pojo.
> e.g. Here is a POJO defined with lombok:
> @Getter
> @Setter
> @NoArgsConstructor
> public class SimplePojo
> Using this Pojo class to read from CSV file throws this exception:
> Exception in thread "main" java.lang.ClassCastException:
> org.apache.flink.api.java.typeutils.GenericTypeInfo cannot be cast to
> org.apache.flink.api.java.typeutils.PojoTypeInfo
> It would be great if flink supports lombok POJO.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)