-
Notifications
You must be signed in to change notification settings - Fork 62
Description
While I was trying to work with NativeTotalItem.java. I found there one unnecessary attributeIdentifiers collection check in first constructor:
this.attributeIdentifiers = attributeIdentifiers == null ? Collections.emptyList() : attributeIdentifiers;
Problem is that this class has two constructors
NativeTotalItem(String, String...)
NativeTotalItem(String, List<String>)
So if accidentally somebody will create native total item in JSON with attributeIdentifiers = null this will fail as it would not be able to pick right constructor NativeTotalItem(String, null)
matches both constructors.
I see here two options how to solve it:
a) remove null check in first constructor as its not needed
b) remove second constructor as they are pretty much the same and looks to me like shortcut