Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRU2023 v10 #162

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9e6b724
GH-56: JAXB Upgrade Plan, Migration to Jakarta EE 10, Migration to Ja…
zubri May 8, 2023
9339793
upgrade to Java 11
zubri May 8, 2023
a56d25c
changelog
zubri May 9, 2023
30574d4
Merge remote-tracking branch 'origin/SRU2023' into SRU2023_v10
zubri Jun 5, 2023
53a5cd2
comment and Idea compiler param update
zubri Jun 6, 2023
2353ab0
Merge branch 'SRU2023' into SRU2023_v10
zubri Jun 14, 2023
6c38831
Merge branch 'SRU2023' into SRU2023_v10
zubri Jun 14, 2023
6ef66b0
release
zubri Jun 14, 2023
55fc7dc
Merge branch 'SRU2023' into SRU2023_v10
zubri Jun 27, 2023
c2043d9
release
zubri Jul 1, 2023
7901a64
spotless code formatting
zubri Aug 4, 2023
db6965f
Merge remote-tracking branch 'origin/SRU2023' into SRU2023_v10
zubri Aug 4, 2023
d848bbd
Merge branch 'SRU2023' into SRU2023_v10
zubri Aug 4, 2023
e222be1
release
zubri Aug 4, 2023
06e69d0
Merge branch 'SRU2023' into SRU2023_v10
zubri Aug 23, 2023
eadb987
Merge branch 'SRU2023' into SRU2023_v10
zubri Aug 23, 2023
ce7b218
release
zubri Aug 23, 2023
f27bff1
Merge branch 'SRU2023' into SRU2023_v10
ptorres-prowide Sep 2, 2023
3e495b7
Merge branch 'SRU2023' into SRU2023_v10
zubri Sep 20, 2023
ca77829
release
zubri Sep 21, 2023
c2dd8b7
Merge branch 'SRU2023' into SRU2023_v10
zubri Sep 22, 2023
f989a6a
Merge branch 'SRU2023' into SRU2023_v10
zubri Oct 14, 2023
1bafbf4
Remove deprecation annotation for fields relocated to the Prowide Int…
zubri Oct 26, 2023
ec42431
Merge branch 'SRU2023' into SRU2023_v10
zubri Oct 30, 2023
bff2ec5
Merge branch 'SRU2023' into SRU2023_v10
zubri Nov 7, 2023
5fb0003
Merge branch 'SRU2023' into SRU2023_v10
zubri Nov 10, 2023
d3c2aa6
Merge branch 'SRU2023' into SRU2023_v10
zubri Nov 11, 2023
e96050d
Merge branch 'SRU2023' into SRU2023_v10
zubri Nov 17, 2023
f38d191
Merge branch 'develop' into SRU2023_v10
zubri Nov 21, 2023
0ca2502
Merge branch 'develop' into SRU2023_v10
zubri Nov 30, 2023
b7cba31
Update gradle to 8.5 and update all plugins rto latest versions
zubri Dec 14, 2023
7711f1d
Merge branch 'develop' into SRU2023_v10
zubri Dec 22, 2023
4360f17
Merge branch 'develop' into SRU2023_v10
zubri Dec 22, 2023
ff4d58c
Merge branch 'develop' into SRU2023_v10
zubri Mar 7, 2024
6432a35
Merge branch 'develop' into SRU2023_v10
zubri Mar 25, 2024
ce46ca4
Merge branch 'develop' into SRU2023_v10
zubri Mar 27, 2024
88c1389
Merge branch 'develop' into SRU2023_v10
zubri May 9, 2024
450ce7f
Merge branch 'develop' into SRU2023_v10
zubri May 23, 2024
4aa5bda
Update CHANGELOG.md
zubri May 23, 2024
a8a504b
Merge branch 'develop' into SRU2023_v10
zubri Jun 28, 2024
e85e9c7
update publishing plugin
zubri Jun 28, 2024
c083729
Merge branch 'main' into SRU2023_v10
zubri Aug 22, 2024
7a7f50e
Merge branch 'main' into SRU2023_v10
zubri Sep 18, 2024
8316563
Merge branch 'main' into SRU2023_v10
zubri Sep 30, 2024
0d26e06
Merge branch 'main' into SRU2023_v10
zubri Sep 30, 2024
db7d108
compile fix (javax -> jakarta)
zubri Sep 30, 2024
9bd19c9
release
zubri Oct 10, 2024
d3f8865
Merge branch 'main' into SRU2023_v10
zubri Oct 10, 2024
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
17 changes: 15 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,18 @@ out
.checkstyle
pom.xml
release.sh
.idea/*
*.pb
.idea/gradle.xml
.idea/jarRepositories.xml
.idea/misc.xml
.idea/modules.xml
.idea/prowide-core.iml
.idea/uiDesigner.xml
.idea/vcs.xml
.idea/workspace.xml
.idea/libraries-with-intellij-classes.xml
.idea/jpa-buddy.xml
.idea/runConfigurations.xml
.idea/.name
*.pb
.java-version
.idea/sonarlint/
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 22 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,71 @@
# Prowide Core - CHANGELOG

#### 9.4.18 - SNAPSHOT
#### 10.1.17 - SNAPSHOT
* Added new `FieldEnum` with all the available field names

#### 9.4.17 - June 2024
#### 10.1.16 - June 2024
* (PW-1913) Added IBAN validation for Egypt local account structure

#### 9.4.16 - May 2024
#### 10.1.15 - May 2024
zubri marked this conversation as resolved.
Show resolved Hide resolved
* (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

#### 9.4.15 - March 2024
#### 10.1.14 - March 2024
zubri marked this conversation as resolved.
Show resolved Hide resolved
* (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

#### 9.4.14 - December 2023
#### 10.1.13 - December 2023
zubri marked this conversation as resolved.
Show resolved Hide resolved
* (PW-1718) Changed the getComponentLabel(component) in Field59F to be dynamic based on the line identifiers (similar to existing API in Field50F)

#### 9.4.13 - November 2023
#### 10.1.12 - November 2023
zubri marked this conversation as resolved.
Show resolved Hide resolved
* (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
* Added DistinguishedName with Builder to encapsulate the BIC branch name logic

#### 9.4.12 - November 2023
#### 10.1.11 - November 2023
zubri marked this conversation as resolved.
Show resolved Hide resolved
* (PW-1697) Fixed validation pattern in fields 14[H,K,L,M,N,O] and 29J

#### 9.4.11 - November 2023
#### 10.1.10 - November 2023
zubri marked this conversation as resolved.
Show resolved Hide resolved
* (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

#### 9.4.10 - October 2023
#### 10.1.9 - 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

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

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

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

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

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

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

#### 9.4.3 - July 2023
#### 10.1.2 - August 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

#### 9.4.2 - June 2023
#### 10.1.1 - July 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

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

#### 9.4.0 - May 2023
Expand Down
42 changes: 27 additions & 15 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:4.7.0'
classpath 'pl.allegro.tech.build:axion-release-plugin:1.14.2'
classpath 'ru.vyarus:gradle-quality-plugin:4.9.0'
classpath 'pl.allegro.tech.build:axion-release-plugin:1.15.1'
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.13.0' // above this version requires Java 11
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.23.3'
}
}
apply plugin: 'pl.allegro.tech.build.axion-release'
Expand Down Expand Up @@ -39,7 +39,7 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion.set(JavaLanguageVersion.of(11))
}
}
doFirst {
Expand All @@ -55,19 +55,25 @@ dependencies {
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'com.google.code.gson:gson:2.9.0'

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'
// 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 event be using JPA or JAXB at all
compileOnly 'jakarta.persistence:jakarta.persistence-api:3.1.0'
compileOnly 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
compileOnly 'jakarta.validation:jakarta.validation-api:3.0.2'
Comment on lines +58 to +62
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Remaining javax.* Imports Detected

The following files still contain imports from javax.* packages:

  • src/main/java/com/prowidesoftware/swift/utils/SafeXmlUtils.java
  • src/main/java/com/prowidesoftware/swift/io/parser/XMLParser.java

Please update these imports to their corresponding jakarta.* packages to ensure compatibility and prevent potential ClassNotFoundException or compilation errors.

🔗 Analysis chain

Ensure All Code Imports Are Updated to 'jakarta.*' Packages

The dependencies have been updated from javax.* to jakarta.* packages:

  • jakarta.persistence:jakarta.persistence-api:3.1.0
  • jakarta.xml.bind:jakarta.xml.bind-api:4.0.0
  • jakarta.validation:jakarta.validation-api:3.0.2

Please verify that all code imports and usages have been updated accordingly to prevent ClassNotFoundException or compilation errors.

Run the following script to find any remaining javax.* imports in the main source code:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find imports from 'javax' packages in the main source code.

# Expected: No imports from 'javax' packages.

rg --type java '^import javax\.' src/main/java/

Length of output: 1099


testImplementation 'javax.persistence:javax.persistence-api:2.2'
testImplementation 'jakarta.persistence:jakarta.persistence-api:3.1.0'
testImplementation('org.junit.jupiter:junit-jupiter:5.8.2')
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.22.0'
testImplementation group: 'org.xmlunit', name: 'xmlunit-core', version: '2.9.0'
testImplementation group: 'org.xmlunit', name: 'xmlunit-matchers', version: '2.9.0'
testImplementation group: 'org.xmlunit', name: 'xmlunit-assertj', version: '2.9.0'
}

sourceSets.main.java.srcDirs = ['src/main/java', 'src/generated/java']
sourceSets.named('main') {
java {
setSrcDirs(['src/main/java', 'src/generated/java'])
}
}

test {
useJUnitPlatform()
Expand All @@ -82,8 +88,8 @@ tasks.withType(Jar) {
'Implementation-Version': project.version,
'Implementation-Vendor': 'www.prowidesoftware.com',
'Built-OS': System.getProperty('os.name'),
'Source-Compatibility': project.sourceCompatibility,
'Target-Compatibility': project.targetCompatibility,
'Source-Compatibility': JavaVersion.VERSION_11,
'Target-Compatibility': JavaVersion.VERSION_11,
'Built-Date': new Date().format("yyyy-MM-dd"),
'Automatic-Module-Name': 'com.prowidesoftware.core'
)
Expand Down Expand Up @@ -258,7 +264,7 @@ tasks.register('bundle', Jar) {
from ("$buildDir/libs") {
include '*.asc'
}
archiveName 'bundle.jar'
archiveFileName.set('bundle.jar')
}

tasks.withType(Test) {
Expand All @@ -281,9 +287,15 @@ task('testOn17', type: Test) {

jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled false
xml {
required.set(true)
}
csv {
required.set(false)
}
html {
required.set(false)
}
}

// exclude generated code
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
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 javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import org.apache.commons.lang3.StringUtils;

/**
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 ISO Alpha-2 country codes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package com.prowidesoftware.swift.constraints;

import com.prowidesoftware.swift.utils.IsoUtils;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import org.apache.commons.lang3.StringUtils;

/**
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 ISO currency codes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package com.prowidesoftware.swift.constraints;

import com.prowidesoftware.swift.utils.IsoUtils;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import org.apache.commons.lang3.StringUtils;

/**
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 IBAN numbers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

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

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
import com.prowidesoftware.deprecation.ProwideDeprecated;
import com.prowidesoftware.deprecation.TargetYear;
import com.prowidesoftware.swift.utils.Lib;
import jakarta.persistence.*;
import jakarta.xml.bind.annotation.XmlTransient;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.*;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlTransient;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
import com.prowidesoftware.swift.model.mt.AbstractMT;
import com.prowidesoftware.swift.model.mt.DefaultMtMetadataStrategy;
import com.prowidesoftware.swift.model.mt.MTVariant;
import jakarta.persistence.Column;
import jakarta.persistence.DiscriminatorValue;
import jakarta.persistence.Entity;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Calendar;
import java.util.Objects;
import java.util.Optional;
import java.util.logging.Level;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.apache.commons.lang3.EnumUtils;
import org.apache.commons.lang3.StringUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/
package com.prowidesoftware.swift.model;

import jakarta.persistence.*;
import java.util.Calendar;
import javax.persistence.*;

/**
* Comments associated to a message for application only usage (not part of the standard).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
package com.prowidesoftware.swift.model;

import static javax.persistence.FetchType.LAZY;
import static jakarta.persistence.FetchType.LAZY;

import jakarta.persistence.*;
import java.util.Calendar;
import java.util.Objects;
import javax.persistence.*;

/**
* A revision is a snapshot of message content and is used to track the history of changes in a message.
Expand Down
Loading
Loading