Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 56 additions & 67 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,45 @@
# Prowide Core - CHANGELOG

### 10.4.2 - June 2026
* Fix: Corrected Field 69G structure per SRU2026 specs update
* Fix: Updating Field 59E due specs update

### 10.4.1 - June 2026
* Fix: Minor scheme fix, 59A in MT760/765/767/785
* Fix: `SwiftTagListBlock.getFieldsByNumber(int)` no longer throws `IllegalArgumentException` when a matching tag cannot be converted into a `Field`; such tags are now logged and skipped, consistently with the name-based lookups

### 10.4.0 - May 2026
### 9.7.0 - July 2026
* SWIFT Standard release update 2026 (live 14 November 2026)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
* `DeprecationUtils` runtime flags now use the JVM system property `PW_DEPRECATED` (also still honored as OS env var); removes the illegal-reflective-access warning.
* Localized label files (`pw_swift_labels_de/es/fr/it/ru.properties`) aligned with the English baseline; missing keys appended with the English value as a fallback pending translation

### 10.3.14 - May 2026

### 9.6.8 - July 2026
* (PW-3185) Fix: `MtSwiftMessage.toJson()` now uses 1-based months (January=1) for Calendar fields and emits a `schemaVersion` marker; `fromJson()` reads both new and legacy (0-based) payloads transparently
* Fix: `SwiftTagListBlock.getFieldsByNumber(int)` no longer throws `IllegalArgumentException` when a matching tag cannot be converted into a `Field`; such tags are now logged and skipped, consistently with the name-based lookups
* Fix: Fields definitions alignment: `Field30I` and `Field30K` component 2 made optional (and `Field30K` validation pattern updated to `<DATE4>[/<DATE4>]`), `Field39M` validation pattern updated to `<CC>`, and `Field56B` name & address component made optional
* Fix: Minor changes in MT message structures from SRU2025 schema: MT306, MT340, MT500-MT502, MT504, MT508, MT510, MT513-MT515, MT518, MT519, MT524, MT527, MT530, MT535-MT538, MT540-MT548, MT558, MT564-MT566, MT575, MT578, MT586, MT600, MT601, MT671
* Feat: Completed and consolidated the field labels across all language bundles (de, en, es, fr, it, ru), filling in missing translations and replacing redundant message-specific entries with generic field names

### 10.3.13 - May 2026
* (PW-3185) `MtSwiftMessage.toJson()` now uses 1-based months (January=1) for Calendar fields and emits a `schemaVersion` marker. `fromJson()` reads both new and legacy (0-based) payloads transparently
* Migrated XML escape/unescape from deprecated `org.apache.commons.lang3.StringEscapeUtils` to `org.apache.commons.text.StringEscapeUtils`. Adds new runtime dependency on `org.apache.commons:commons-text:1.15.0`
* Updated gson from 2.13.2 to 2.14.0

### 10.3.12 - March 2026
* Fix: Replaced `@OrderColumn` with `@OrderBy("creationDate ASC")` on `statusTrail`, `notes`, and `revisions` to prevent data loss caused by `sort_key` corruption under concurrent access. Existing `sort_key` columns must be made nullable or dropped
#### 9.6.7 - April 2026
* Fix: Replaced `@OrderColumn` with `@OrderBy("creationDate ASC")` on `statusTrail`, `notes`, and `revisions` to prevent data loss caused by `sort_key` corruption under concurrent access. Existing `sort_key` columns must be made nullable or dropped.
* Feat: Improved performance of `SwiftParseUtils.getLines()` by replacing `BufferedReader` with direct string index parsing

### 10.3.11 - March 2026
* Feat: `MtSwiftMessage` created from ACK (service 21) followed by MT with block 2 Output now extracts the message type and metadata from the appended MT instead of defaulting to ACK

#### 10.3.10 - March 2026
* Migrated deprecated `StringUtils` methods to `Strings.CS` equivalents (equals, startsWith, endsWith, contains, replace, indexOf, lastIndexOf, remove, removeEnd)
* (PW-3126) Fixed DN to BIC extraction in `DistinguishedName` to include the branch code from the `ou` component
* (PW-3123) Feat: Added `checksum()` and `checksumBody()` default methods to `MessageMetadataStrategy` (useful for duplicate detection)
* (PW-3123) Feat: Made `SwiftMessageUtils.md5()` public for checksum computation in custom implementations

#### 10.3.9 - February 2026
* Deprecated `Field.validatorPattern()` - validation patterns moved to Integrator's `FieldPatternRegistry`
* Updated MT message structures from schema regeneration (MT081, MT513-MT543, MT586, MT920, MT942)

#### 10.3.8 - January 2026
* Updated MT message structures from schema regeneration (MT081, MT513-MT543, MT586, MT920, MT942)
* (PW-2967) Fixed Field95D component label from "Legal Entity Identifier" to "Digital Ledger Identifier" to match XSD schema
* Feat: `MtSwiftMessage` now automatically extracts and persists UETR from block 3 field 121 during message parsing
* Fix: Added missing `uetr` field to `AbstractSwiftMessage` `copyTo()`, `equals()`, and `hashCode()` methods
* Updated apache-commons-lang3 from 3.17.0 to 3.20.0
* Updated gson from 2.11.0 to 2.13.2

#### 10.3.7 - November 2025
#### 9.6.6 - November 2025
* fix: `MT544-547` Field19 NTWK Option as per SRU2025 UG
* (PW-2907) Fixed format for Field 31W from DATE4 to DATE2

#### 10.3.6 - August 2025
#### 9.6.5 - August 2025
* feat: Enhanced SwiftParser for edge cases avoiding OutOfBoundsException when parsing messages with empty blocks
* fix: `LogicalTerminalAddress` sender LT "X" is now the default instead of "A" for load balancing by Messaging Interface

#### 10.3.5 - September 2025
#### 9.6.4 - September 2025
* feat: Enhanced SwiftParser for edge cases avoiding OutOfBoundsException when parsing messages with empty blocks
* (PW-2613) Updated the Field70 codeword splitting logic to allow / as trailing chars

#### 10.3.4 - July 2025
#### 9.6.3 - July 2025
* (PW-2594) Fixed format for Fields 60, 62, 64, and 65 to ensure the DC component is mandatory.
* (PW-2541) Updated the narrative resolver, format field 70 (used in field 70), to allow multiple lines and using // as codeword separator (/CODEWORD1/text///CODEWORD2/text)
* Fix: Enhanced the Xml parsing logic to escape/unescape `<` and `>` characters in the XML content
Expand All @@ -69,7 +49,7 @@
* Feat: Enhanced the `SwiftMessageComparator` to allow less strict comparison regarding Block2's Sender Input Time and Receiver Output Time
* Feat: Added xsd for validating the result for AbstractMt.xml() output

#### 10.3.3 - July 2025
#### 9.6.2 - July 2025
* (PW-2541) Updated the narrative resolver, format field 70 (used in field 70), to allow multiple lines and using // as codeword separator (/CODEWORD1/text///CODEWORD2/text)
* Fix: Adding a new entry to SchemeConstantsR class
* Fix: Enhanced the Xml parsing logic to escape/unescape `<` and `>` characters in the XML content
Expand All @@ -79,115 +59,124 @@
* Feat: Enhanced the `SwiftMessageComparator` to allow less strict comparison regarding Block2's Sender Input Time and Receiver Output Time
* Feat: Added xsd for validating the result for AbstractMt.xml() output

#### 10.3.2 - June 2025
#### 9.6.1 - June 2025
* Fix: Updated components for Field 13W

#### 10.3.1 - June 2025
* (PW-2055) Fixed the default message metadata extraction for ACK/NAK to set the service message block 1 BIC as receiver, not as sender
* (PW-2055) Enhanced the `SwiftMessageUtils` extractors to support the service 21 message type (ACK/NAK)
* Fix: Enhanced the `DefaultMtMetadataStrategy` to prevent NPE when the message headers are malformed

#### 10.3.0 - May 2025
#### 9.6.0 - June 2025
* SWIFT Standard release update 2025 (live 22 November 2025)
* Yearly revision of the deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
* Dependency update: commons-lang3 -> 3.17.0
* Dependency update: gson -> 2.13.1
* Changed field 70 narrative resolver to use the free format parser, code/narrative appearing anywhere, not just at the beginning of a line
* (PW-2371) Added a `uetr` field in the `AbstractSwiftMessage` to store the message's unique end-to-end transaction reference (UETR)

#### 10.2.6 - April 2025
#### 9.5.8 - June 2024
* Fix: Enhanced the `DefaultMtMetadataStrategy` to prevent NPE when the message headers are malformed
* Feat: Added an XSD for validating the Prowide Core proprietary XML version for MT messages generated by the `xml()` method for the `AbstractMT` and subclasses
* Feat: Added JSON schemas for the Prowide Core proprietary JSON version for MT messages generated by the `toJson()` method for the `SwiftMessage` and `MtSwiftMessage` classes
* Feat: Enhanced the `SwiftMessageComparator` to allow less strict comparison regarding Block2's Sender Input Time and Receiver Output Time
* Feat: Added xsd for validating the result for AbstractMt.xml() output
* Fix: Updated components for Field 13W

#### 9.5.7 - May 2025
* (PW-2055) Fixed the default message metadata extraction for ACK/NAK to set the service message block 1 BIC as receiver, not as sender
* (PW-2055) Enhanced the `SwiftMessageUtils` extractors to support the service 21 message type (ACK/NAK)
* Fix: Enhanced the `DefaultMtMetadataStrategy` to prevent NPE when the message headers are malformed
* Changed field 70 narrative resolver to use the free format parser, code/narrative appearing anywhere, not just at the beginning of a line

#### 9.5.6 - April 2025
* (CU-86b49rvw4) Updated label for Fields 14[P,Q,R]/16W/29[Q,W]
* (PW-2239) BIC Branch check for all upper and lower case
* (PW-2239) Notify Test and Training BIC usage in DN.

#### 10.2.5 - December 2024
#### 9.5.5 - December 2024
* Update apache-commons-lang3 from 3.14.0 to 3.17.0 fixing derived apache-text dependency vulnerabilities
* Minor thread safety fix in the `PropertyLoaded` class, used by the `SafeXmlUtils`
* Gradle wrapper update to 8.12

#### 10.2.4 - November 2024
#### 9.5.4 - November 2024
* Rolling back SHA-256 checksum algorithm to MD5 in the MT message model

#### 10.2.3 - November 2024
#### 9.5.3 - November 2024
* (PW-2040) Updated the BBAN validation data file to the IBAN REGISTRY Jul 2024 release
* (PW-2006) Fixed `getMUR` and `setMUR` in `SwiftMessage` to prioritize field 108 in block 4 over block 3 for system messages (category 0)
* Added new `MtSequenceEnum` with all the available inner sequences of specific MT schemas
* Added `isSystemMessage()` to SwiftMessage to check if the message is a category 0 message (010. 011, etc...)
* Added new `MtSequenceEnum` with all the available inner sequences of specific MT schemas

#### 10.2.2 - October 2024
#### 9.5.2 - October 2024
* Added new `FieldEnum` with all the available field names
* Code security improvements as per CodeQL recommendations

#### 10.2.1 - June 2024
#### 9.5.1 - June 2024
* (PW-1913) Added IBAN validation for Egypt local account structure
* Restore deprecated method in MT210 class

#### 10.2.0 - May 2024
#### 9.5.0 - May 2024
* SWIFT Standard release update 2024 (live 16 November 2025)
* Yearly revision of deprecation phase (see https://dev.prowidesoftware.com/SRU2024/getting-started/deprecation/)
* Dependency update: commons-lang3 -> 3.14.0
* Dependency update: gson -> 2.11.0
* Dependency update: commons-lang3 -> 3.14.0'
* Dependency update: gson -> 2.11.0'

#### 10.1.15 - May 2024
#### 9.4.16 - May 2024
* (PW-1862) Added NarrativeFragment class for detailed line information in StructuredNarrative fragments
* Fixed SwiftMessage getPDE(): return empty value instead of null when codeword exists and has no value
* Added isPercentage() helper method to field 37K

#### 10.1.14 - March 2024
#### 9.4.15 - March 2024
* (PW-1812) Updated the narrative resolver, format 2 (used in field 72 for example), to allow empty values as part of the narrative fragment
* Updated validators for BIC, country, and currency constraints to utilize keywords for i18n-compatible messages
* Deprecated unnecessary methods in the SafeXmlUtils class

#### 10.1.13 - December 2023
#### 9.4.14 - December 2023
* (PW-1718) Changed the getComponentLabel(component) in Field59F to be dynamic based on the line identifiers (similar to existing API in Field50F)

#### 10.1.12 - November 2023
#### 9.4.13 - November 2023
* (PW-1697) Fixed validation/parse pattern in field 29O
* (PW-1697) MT306 changes in field 30I
* Added DistinguishedName with Builder in order to encapsulate the BIC branch name logic

#### 10.1.11 - November 2023
#### 9.4.12 - November 2023
* (PW-1697) Fixed validation pattern in fields 14[H,K,L,M,N,O] and 29J

#### 10.1.10 - November 2023
#### 9.4.11 - November 2023
* (PW-1695) Fixed a stack overflow in the fields fromJson implementation when a malformed JSON input contains empty field names
* (PW-1688) Added missing field labels for SRU2023 changes in the pw_swift_*.properties file

#### 10.1.9 - October 2023
#### 9.4.10 - October 2023
* (PW-1675) update to Field 31R to support also two date components as requested by SCORE messages
* Added 36B and 36D getters to MT543

#### 10.1.8 - October 2023
#### 9.4.9 - October 2023
* (PW-1659) Field 24G deprecated Name and Address for Narrative

#### 10.1.7 - October 2023
#### 9.4.8 - October 2023
* Added default methods for sender, receiver, and identifier extraction to the MessageExtractionStrategy
* Added JSON to the `FileFormat` enumeration

#### 10.1.6 - September 2023
#### 9.4.7 - September 2023
* (PW-1478) Fixed Field 44J parse and getValue to enable proper data preservation when the field contains multiline content

#### 10.1.5 - September 2023
#### 9.4.6 - September 2023
* Added support for an optional `pw-swift-core.properties` to customize the behavior of the SafeXmlUtils class

#### 10.1.4 - September 2023
#### 9.4.5 - August 2023
* (PW-1478) Field 44J parse and getValue fix

#### 10.1.3 - August 2023
#### 9.4.4 - August 2023
* (PW-1478) Field 44J format fixed to allow multiline

#### 10.1.2 - August 2023
#### 9.4.3 - July 2023
* (PW-1461) Remove deprecation of field 31R model since is it used back in SRU2023
* (PW-1405) Trim original String payload when creating an AbstractSwiftMessage

#### 10.1.1 - July 2023
#### 9.4.2 - June 2023
* (GH-163) Remove unnecessary padding in sender and receiver in AbstractMT#creeate(number, sender, receiver) method
* (PW-1323) Fixing getValue method for pattern issue in Field44J

#### 10.1.0 - June 2023
* Migration to Java 11
* Migration to Jakarta EE 10
* (PW-1323) Fixing getValue method for pattern issue in Field44J
#### 9.4.1 - June 2023
* (PW-1323) Fixing missing pattern issue in Field44J

#### 9.4.0 - May 2023
Expand Down
47 changes: 25 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath 'ru.vyarus:gradle-quality-plugin:6.1.0'
classpath 'pl.allegro.tech.build:axion-release-plugin:1.18.18'
classpath 'ru.vyarus:gradle-quality-plugin:5.0.0'
classpath 'pl.allegro.tech.build:axion-release-plugin:1.14.5' // starting with version 15.* requires Java 11
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:7.0.3'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.13.0' // above this version requires Java 11
}
}
apply plugin: 'pl.allegro.tech.build.axion-release'
Expand All @@ -34,11 +34,12 @@ scmVersion {
versionSeparator = '-'
}
}
project.version = "${SRU}-${scmVersion.version}"
//project.version = "${SRU}-${scmVersion.version}"
project.version = "SRU2026-9.7.0"

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(8))
}
}

Expand All @@ -58,17 +59,15 @@ dependencies {
implementation 'org.apache.commons:commons-text:1.15.0'
implementation 'com.google.code.gson:gson:2.14.0'

// jakarta is only used for annotations, we do not add it as implementation dependency on purpose to avoid forcing
// users to use jakarta jars in their project when they might not even be using JPA or JAXB at all
compileOnly 'jakarta.persistence:jakarta.persistence-api:3.1.0' // jakarta 3.1 is Jakarta EE 10, jakarta 3.2 would imply migration to Jakarta EE 11
compileOnly 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.5'
compileOnly 'jakarta.validation:jakarta.validation-api:3.1.1'

testImplementation 'com.networknt:json-schema-validator:2.0.1'
testImplementation 'jakarta.persistence:jakarta.persistence-api:3.1.0'
testImplementation 'jakarta.validation:jakarta.validation-api:3.1.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.14.4'
testImplementation 'org.junit.platform:junit-platform-launcher:1.14.4'
compileOnly 'javax.persistence:javax.persistence-api:2.2'
compileOnly 'javax.xml.bind:jaxb-api:2.3.1'
compileOnly 'javax.validation:validation-api:2.0.1.Final'

testImplementation 'javax.validation:validation-api:2.0.1.Final'
testImplementation 'javax.persistence:javax.persistence-api:2.2'
testImplementation 'com.networknt:json-schema-validator:1.5.8'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
testImplementation 'org.junit.platform:junit-platform-launcher:1.11.4'
testImplementation 'org.assertj:assertj-core:3.27.6'
testImplementation 'org.xmlunit:xmlunit-core:2.12.0'
testImplementation 'org.xmlunit:xmlunit-matchers:2.12.0'
Expand All @@ -94,8 +93,8 @@ tasks.withType(Jar).configureEach {
'Implementation-Version': project.version,
'Implementation-Vendor': 'www.prowidesoftware.com',
'Built-OS': System.getProperty('os.name'),
'Source-Compatibility': JavaVersion.VERSION_11,
'Target-Compatibility': JavaVersion.VERSION_11,
'Source-Compatibility': JavaVersion.VERSION_1_8,
'Target-Compatibility': JavaVersion.VERSION_1_8,
'Built-Date': new Date().format("yyyy-MM-dd"),
'Automatic-Module-Name': 'com.prowidesoftware.core'
)
Expand Down Expand Up @@ -323,25 +322,29 @@ tasks.register('bundle', Zip) {
}

tasks.withType(Test).configureEach {
// DeprecationUtils#setEnv reflects into java.lang.ProcessEnvironment (and falls back to
// java.util.Collections$UnmodifiableMap) on purpose; open both packages so the JVM does
// not print illegal-access warnings on JDK 11+.
jvmArgs '--add-opens=java.base/java.lang=ALL-UNNAMED', '--add-opens=java.base/java.util=ALL-UNNAMED'
doFirst {
println 'Running test on ' + getJavaLauncher().get().getMetadata().getInstallationPath()
}
}

// DeprecationUtils#setEnv reflects into java.lang.ProcessEnvironment (and falls back to
// java.util.Collections$UnmodifiableMap) on purpose; open both packages so the JVM does
// not print illegal-access warnings on JDK 11+. Not needed (and not supported) on the
// Java 8 toolchain used by the default 'test' task.
def addOpensJvmArgs = ['--add-opens=java.base/java.lang=ALL-UNNAMED', '--add-opens=java.base/java.util=ALL-UNNAMED']

tasks.register('testOn17', Test) {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
}
jvmArgs addOpensJvmArgs
}

tasks.register('testOn21', Test) {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
}
jvmArgs addOpensJvmArgs
}

jacocoTestReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

import static java.lang.annotation.ElementType.*;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;

/**
* Bean validation for BIC numbers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import com.prowidesoftware.swift.model.BIC;
import com.prowidesoftware.swift.model.BicValidationResult;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.apache.commons.lang3.StringUtils;

/**
Expand Down
Loading
Loading