Commit 4a985b9
committed
Imnprove PDF-Importer use convenience constructors, normalize wrap blocks and ExtractorMatchers
Replace the verbose three-line subject lambda with the AccountTransaction(Type) convenience constructor introduced in #5614 across all PDF importers.
**Additionally:**
- Add BuySellEntry(PortfolioTransaction.Type) and PortfolioTransaction(Type) convenience constructors and apply the same single-line subject lambda pattern to all BuySellEntry and PortfolioTransaction subject lambdas
- Convert the remaining three verbose AccountTransferEntry subject lambdas to method references (AccountTransferEntry::new)
- Replace setCurrencyCode(CurrencyUnit.X) with setCurrencyCode(asCurrencyCode("X"))
- Add missing t.getCurrencyCode() != null guard to bare t.getAmount() == 0 checks
- Normalize all simple wrap blocks to a consistent if/return SkippedItem format, removing intermediate item variables and unused ctx parameters
- Add final modifier to all var type = new DocumentType(...) declarations
**Improvement Arkéa Direct Bank and ExtractorMatchers**
- Extend `hasExDate(String)` to accept `null`, allowing dividend tests to explicitly assert that no ex-date is present in a document
- Add `hasExDate(null)` assertions to all three dividend tests to document the absence of an ex-date in Arkéa Direct Bank documents
**Normalize currency handling in DocumentContext**
- Extend `hasExDate(String)` to accept `null`, allowing dividend tests to explicitly assert that no ex-date is present in a document
- Add `hasExDate(null)` assertions to all three dividend tests to document the absence of an ex-date in Arkéa Direct Bank documents
**Normalize currency handling in DocumentContext**
- Fix missing asCurrencyCode() in ctx.put("currency", ...) in BundesschatzPDFExtractor (two document types stored the raw captured string instead of the normalized currency code)
- Remove redundant asCurrencyCode() wrapping in 15 extractors where currency is read back via .documentContext("currency") — the value stored in the context is already normalized, so the second call was unnecessary
(affected: ABNAMROGroup, AkfBank, AudiBank, AustrianAnadi, BarclaysBankIreland, BawagAG, BoursesDirect, Bundesschatz, Crowdestor, DKB, INGDiBa, RaiffeisenBankgruppe, SantanderConsumerBank, Tradegate, VolkswagenBank)
**Normalize currency handling — fixed-currency extractors and raw section reads**
- Introduce `private static final String XXX = "XXX"` constants and replace all `CurrencyUnit.XXX` object references and unwrapped bare string literals with `asCurrencyCode(XXX)` in fixed-currency extractors (affected:
LimeTradingCorp, FidelityInternational, Computershare, AvivaPLC, ScorePriorityInc, Simpel, Sunrise, SutorBankGmbH, KFintech)
- Wrap `v.put("currency", stripBlanks(...))` with `asCurrencyCode()` where currency is captured from raw PDF text (affected: Comdirect 4×, Commerzbank 1×, LibertyVorsorgeAG 7×)
- Wrap `v.put("currency", v.get("currency1/2"))` with `asCurrencyCode()` for currency1/currency2 relay patterns (affected: Consorsbank 12×, DZBankGruppe 6×, DKB 6×, INGDiBa 6×, Postbank 6×)
- Wrap `Money.of(v.get("currency/feeCurrency"), ...)` with `asCurrencyCode()` in BSDEXPDFExtractor where both currency fields are extracted locally from raw PDF text (8× across buy/sell sections)
**Improve asCurrencyCode() in AbstractPDFExtractor and fix TextUtil.trim()**
- Replace `currency.trim()` (Java's String.trim, strips only ASCII ≤ 0x20) with `TextUtil.trim()` (already statically imported) which additionally handles Unicode spaces such as U+00A0 (NO-BREAK SPACE) and U+FEFF
(Zero-Width BOM)
- Fix asymmetric bug in `TextUtil.trim()`: the trailing whitespace loop used `Character.isWhitespace()` while the leading loop used the more comprehensive `TextUtil.isWhitespace()` — U+00A0, U+202F and U+FEFF were
therefore trimmed leading but not trailing; both loops now use `TextUtil.isWhitespace()`
- As a side effect, `MessagesTest` now detects a stray U+202F (NARROW NO-BREAK SPACE) trailing in the Spanish translation key `AttributeSettings_LimitPrice_ColorSettings` — removed
- Add `TextUtilTest.testTrim()` covering regular whitespace, U+00A0 and U+FEFF trimming on both sides
- Add `AbstractPDFExtractorTest` covering: standard ISO codes, U+00A0 trimming, regular whitespace trimming, null input, and unknown-code fallback to base currency1 parent c6181a7 commit 4a985b9
150 files changed
Lines changed: 5800 additions & 11407 deletions
File tree
- .claude/rules
- name.abuchen.portfolio.tests/src/name/abuchen/portfolio
- datatransfer
- pdf
- arkeadirectbank
- consorsbank
- dekabank
- direkt1822bank
- dkb
- fintechgroupbank
- ingdiba
- modenaestonia
- oldenburgischelandesbankag
- raiffeisenbankgruppe
- sbroker
- tradegateag
- wirbank
- util
- name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui
- name.abuchen.portfolio/src/name/abuchen/portfolio
- datatransfer/pdf
- model
- util
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
23 | 101 | | |
24 | 102 | | |
25 | 103 | | |
| |||
66 | 144 | | |
67 | 145 | | |
68 | 146 | | |
| 147 | + | |
Lines changed: 18 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
| 209 | + | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
| 383 | + | |
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
394 | | - | |
| 394 | + | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
| 428 | + | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
| 438 | + | |
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
466 | | - | |
467 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
| |||
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
477 | | - | |
| 478 | + | |
478 | 479 | | |
479 | 480 | | |
480 | 481 | | |
| |||
511 | 512 | | |
512 | 513 | | |
513 | 514 | | |
514 | | - | |
| 515 | + | |
515 | 516 | | |
516 | 517 | | |
517 | 518 | | |
| |||
547 | 548 | | |
548 | 549 | | |
549 | 550 | | |
550 | | - | |
| 551 | + | |
551 | 552 | | |
552 | 553 | | |
553 | 554 | | |
| |||
590 | 591 | | |
591 | 592 | | |
592 | 593 | | |
593 | | - | |
| 594 | + | |
594 | 595 | | |
595 | 596 | | |
596 | 597 | | |
| |||
Lines changed: 23 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
281 | 299 | | |
282 | 300 | | |
283 | 301 | | |
| |||
Lines changed: 82 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
0 commit comments