@@ -114,23 +114,23 @@ protected List<Integer> extractCategory(String fragment) {
114
114
log .debug ("Determining category from a fragment: '{}'" , fragment );
115
115
116
116
String [] names = StringUtils .split (fragment , "\n \t ," );
117
- List <String > uniqueCandidates = Arrays .stream (names )
117
+ List <String > candidates = Arrays .stream (names )
118
118
.filter (tooShortCategoryName )
119
119
.filter (tooLongCategoryName )
120
120
.filter (invalidCategoryName )
121
121
.distinct ()
122
122
.limit (MAX_CANDIDATES_FOR_LOOKUP )
123
123
.collect (Collectors .toList ());
124
124
125
- log .debug ("Possible candidates: {}" , uniqueCandidates );
125
+ log .debug ("Possible candidates: {}" , candidates );
126
126
127
- List <Integer > categories = categoryService .findIdsByNames (uniqueCandidates );
127
+ List <Integer > categories = categoryService .findIdsByNames (candidates );
128
128
log .debug ("Found categories: {}" , categories );
129
129
if (!categories .isEmpty ()) {
130
130
return categories ;
131
131
}
132
132
133
- for (String candidate : uniqueCandidates ) {
133
+ for (String candidate : candidates ) {
134
134
log .debug ("Possible candidate: '{}%'" , candidate );
135
135
categories = categoryService .findIdsWhenNameStartsWith (candidate );
136
136
if (!categories .isEmpty ()) {
@@ -154,23 +154,23 @@ protected List<Integer> extractCountry(String fragment) {
154
154
log .debug ("Determining country from a fragment: '{}'" , fragment );
155
155
156
156
String [] names = StringUtils .split (fragment , "\n \t ," );
157
- List <String > uniqueCandidates = Arrays .stream (names )
157
+ List <String > candidates = Arrays .stream (names )
158
158
.filter (tooShortCountryName )
159
159
.filter (tooLongCountryName )
160
160
.filter (invalidCountryName )
161
161
.distinct ()
162
162
.limit (MAX_CANDIDATES_FOR_LOOKUP )
163
163
.collect (Collectors .toList ());
164
164
165
- log .debug ("Possible candidates: {}" , uniqueCandidates );
165
+ log .debug ("Possible candidates: {}" , candidates );
166
166
167
- List <Integer > countries = countryService .findIdsByNames (uniqueCandidates );
167
+ List <Integer > countries = countryService .findIdsByNames (candidates );
168
168
log .debug ("Found countries: {}" , countries );
169
169
if (!countries .isEmpty ()) {
170
170
return countries ;
171
171
}
172
172
173
- for (String candidate : uniqueCandidates ) {
173
+ for (String candidate : candidates ) {
174
174
log .debug ("Possible candidate: '{}%'" , candidate );
175
175
countries = countryService .findIdsWhenNameStartsWith (candidate );
176
176
if (!countries .isEmpty ()) {
0 commit comments