@@ -422,6 +422,7 @@ public SeriesExtractedInfo extract(String pageUrl, RawParsedDataDto data) {
422
422
"PMD.AvoidInstantiatingObjectsInLoops" ,
423
423
"PMD.AvoidReassigningParameters" ,
424
424
"PMD.NPathComplexity" ,
425
+ "PMD.ModifiedCyclomaticComplexity" ,
425
426
"checkstyle:parameterassignment"
426
427
})
427
428
/* default */ BigDecimal extractPrice (String fragment ) {
@@ -437,7 +438,7 @@ public SeriesExtractedInfo extract(String pageUrl, RawParsedDataDto data) {
437
438
fragment = matcher .replaceAll ("$1$2" );
438
439
}
439
440
440
- String prefix = "US$" ;
441
+ String [] prefixes = new String []{ "US$" , "€" } ;
441
442
String postfix = "$" ;
442
443
443
444
String [] candidates = StringUtils .split (fragment , ' ' );
@@ -455,9 +456,12 @@ public SeriesExtractedInfo extract(String pageUrl, RawParsedDataDto data) {
455
456
if (candidate .endsWith (postfix ) && candidate .length () > postfix .length ()) {
456
457
candidate = StringUtils .substringBeforeLast (candidate , postfix );
457
458
}
458
- // "US$10" -> "10"
459
- if (candidate .startsWith (prefix ) && candidate .length () > prefix .length ()) {
460
- candidate = StringUtils .substringAfter (candidate , prefix );
459
+ // "${prefix}10" -> "10"
460
+ for (String prefix : prefixes ) {
461
+ if (candidate .startsWith (prefix ) && candidate .length () > prefix .length ()) {
462
+ candidate = StringUtils .substringAfter (candidate , prefix );
463
+ break ;
464
+ }
461
465
}
462
466
try {
463
467
BigDecimal price = new BigDecimal (candidate );
0 commit comments