Skip to content
Permalink
Browse files
[REFACTORING] AbstractEntityBuilder was colling toLowerCase twice
  • Loading branch information
chibenwa committed May 25, 2021
1 parent 935bb88 commit 4551299e1de15281d42b42c21231bb0eb8f1fd40
Showing 1 changed file with 3 additions and 2 deletions.
@@ -66,10 +66,11 @@ public AbstractEntityBuilder() {
* @param field the field to add.
*/
public AbstractEntityBuilder addField(Field field) {
List<Field> values = fieldMap.get(field.getName().toLowerCase(Locale.US));
String lowerCasedFieldName = field.getName().toLowerCase(Locale.US);
List<Field> values = fieldMap.get(lowerCasedFieldName);
if (values == null) {
values = new LinkedList<Field>();
fieldMap.put(field.getName().toLowerCase(Locale.US), values);
fieldMap.put(lowerCasedFieldName, values);
}
values.add(field);
fields.add(field);

0 comments on commit 4551299

Please sign in to comment.