Skip to content

Commit

Permalink
[FLINK-2874] Fix recognition of Scala default setters
Browse files Browse the repository at this point in the history
  • Loading branch information
fhueske committed Oct 22, 2015
1 parent 17e7b42 commit cd7ed8e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,9 @@ private boolean isValidPojoField(Field f, Class<?> clazz, ArrayList<Type> typeHi
fieldType = materializeTypeVariable(typeHierarchy, (TypeVariable<?>)fieldType);
}
for(Method m : clazz.getMethods()) {
final String methodNameLow = m.getName().toLowerCase().replaceAll("_", "");
final String methodNameLow = m.getName().endsWith("_$eq") ?
m.getName().toLowerCase().replaceAll("_", "").replaceFirst("\\$eq$", "_\\$eq") :
m.getName().toLowerCase().replaceAll("_", "");

// check for getter
if( // The name should be "get<FieldName>" or "<fieldName>" (for scala) or "is<fieldName>" for boolean fields.
Expand Down

0 comments on commit cd7ed8e

Please sign in to comment.