(geronimo-mail) branch main updated: Switch from newInstance() to getConstructor().newInstance()

[email protected] Fri, 19 Dec 2025 09:47:19 +0000
Newsgroups gmane.comp.java.geronimo.cvs
Message-ID <176613763916.3268918.1104529104004725517@gitbox3-he-fi.apache.org>
This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/geronimo-mail.git


The following commit(s) were added to refs/heads/main by this push:
     new acec825  Switch from newInstance() to getConstructor().newInstance()
acec825 is described below

commit acec825a1112efe18282cab2a44393e594f1d622
Author: Richard Zowalla <[email protected]>
AuthorDate: Fri Dec 19 10:47:12 2025 +0100

    Switch from newInstance() to getConstructor().newInstance()
---
 .../src/main/java/org/apache/geronimo/mail/util/MailConnection.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/geronimo-mail_2.1_impl/geronimo-mail_2.1_provider/src/main/java/org/apache/geronimo/mail/util/MailConnection.java b/geronimo-mail_2.1_impl/geronimo-mail_2.1_provider/src/main/java/org/apache/geronimo/mail/util/MailConnection.java
index 818af23..fcc1e49 100644
--- a/geronimo-mail_2.1_impl/geronimo-mail_2.1_provider/src/main/java/org/apache/geronimo/mail/util/MailConnection.java
+++ b/geronimo-mail_2.1_impl/geronimo-mail_2.1_provider/src/main/java/org/apache/geronimo/mail/util/MailConnection.java
@@ -360,7 +360,7 @@ public class MailConnection {
 
                 Object defFactory;
                 try {
-                	defFactory = factoryClass.newInstance();
+                	defFactory = factoryClass.getConstructor().newInstance();
                 } catch (Throwable t) {
                 	Method getDefault = factoryClass.getMethod("getDefault", new Class[0]); //TODO check instantiation of socket factory
                 	defFactory = getDefault.invoke(new Object(), new Object[0]);