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

Fix backward compatibility issue with Java17 migration #717

Merged
merged 10 commits into from
Sep 15, 2023
16 changes: 11 additions & 5 deletions ballerina/Ballerina.toml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerina"
name = "email"
version = "2.8.0"
version = "2.8.1"
authors = ["Ballerina"]
keywords = ["email", "SMTP", "POP", "POP3", "IMAP", "mail"]
repository = "https://github.com/ballerina-platform/module-ballerina-email"
Expand Down Expand Up @@ -30,15 +30,21 @@ artifactId = "mimepull"
version = "1.9.11"
path = "./lib/mimepull-1.9.11.jar"

[[platform.java11.dependency]]
groupId = "javax.activation"
artifactId = "activation"
version = "1.1.1"
path = "./lib/activation-1.1.1.jar"

[[platform.java11.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "email-native"
version = "2.8.0"
path = "../native/build/libs/email-native-2.8.0.jar"
version = "2.8.1"
path = "../native/build/libs/email-native-2.8.1-SNAPSHOT.jar"

[[platform.java11.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "email-test-utils"
version = "2.8.0"
path = "../test-utils/build/libs/email-test-utils-2.8.0.jar"
version = "2.8.1"
path = "../test-utils/build/libs/email-test-utils-2.8.1-SNAPSHOT.jar"
scope = "testOnly"
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "email-compiler-plugin"
class = "io.ballerina.stdlib.email.compiler.EmailCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/email-compiler-plugin-2.8.0.jar"
path = "../compiler-plugin/build/libs/email-compiler-plugin-2.8.1-SNAPSHOT.jar"
4 changes: 2 additions & 2 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ distribution-version = "2201.7.0"
[[package]]
org = "ballerina"
name = "email"
version = "2.8.0"
version = "2.8.1"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.runtime"},
Expand Down Expand Up @@ -119,7 +119,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.8.0"
version = "2.8.1"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand Down
3 changes: 3 additions & 0 deletions ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ dependencies {
externalJars(group: 'org.jvnet.mimepull', name: 'mimepull', version: "${mimepullVersion}") {
transitive = false
}
externalJars(group: 'javax.activation', name: 'activation', version: "${javaxActivationVersion}") {
transitive = false
}
}

task updateTomlFiles {
Expand Down
6 changes: 6 additions & 0 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ artifactId = "mimepull"
version = "1.9.11"
path = "./lib/mimepull-1.9.11.jar"

[[platform.java11.dependency]]
groupId = "javax.activation"
artifactId = "activation"
version = "1.1.1"
path = "./lib/activation-1.1.1.jar"

[[platform.java11.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "email-native"
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version=2.8.1-SNAPSHOT
slf4jVersion=1.7.30
testngVersion=7.4.0
javaMailVersion=1.6.2
javaxActivationVersion=1.1.1
greenmailVersion=1.5.11
mimepullVersion=1.9.11
puppycrawlCheckstyleVersion=8.18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,6 @@ public class EmailAccessClient {

private EmailAccessClient() {}

static {
Class<?> hostNameCheckerClass = null;
try {
hostNameCheckerClass = Class.forName(EmailConstants.HOSTNAME_CHECKER_CLASS);
} catch (ClassNotFoundException e) {
log.error("sun.security.util.HostnameChecker class was not found from EmailAccessClient.");
}
if (hostNameCheckerClass != null) {
String hostNameCheckerPackageName = hostNameCheckerClass.getPackageName();
Module emailAccessClientModule = EmailAccessClient.class.getModule();
hostNameCheckerClass.getModule().addOpens(hostNameCheckerPackageName, emailAccessClientModule);
}
}

/**
* Initializes the BObject object with the POP properties.
* @param clientEndpoint Represents the POP Client class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@ public class SmtpClient {

private SmtpClient() {}

static {
Class<?> hostNameCheckerClass = null;
try {
hostNameCheckerClass = Class.forName(EmailConstants.HOSTNAME_CHECKER_CLASS);
} catch (ClassNotFoundException e) {
log.error("sun.security.util.HostnameChecker class was not found from SmtpClient.");
}
if (hostNameCheckerClass != null) {
String hostNameCheckerPackageName = hostNameCheckerClass.getPackageName();
Module smtpClientModule = SmtpClient.class.getModule();
hostNameCheckerClass.getModule().addOpens(hostNameCheckerPackageName, smtpClientModule);
}
}

/**
* Initializes the BObject object with the SMTP Properties.
* @param clientEndpoint Represents the SMTP Client class
Expand Down
Loading