sebsoftware commented on code in PR #2:
URL: https://github.com/apache/geronimo-mail/pull/2#discussion_r2508022611


##########
geronimo-mail_2.1_impl/geronimo-mail_2.1_provider/src/main/java/org/apache/geronimo/mail/util/MailConnection.java:
##########
@@ -354,10 +354,22 @@ private boolean createSocketFromFactory(boolean ssl, 
boolean layer) throws IOExc
                 // done indirectly, we need to invoke the method using 
reflection.
                 // This retrieves a factory instance.
                 //Method getDefault = factoryClass.getMethod("getDefault", new 
Class[0]); //TODO check instantiation of socket factory
-                Object defFactory = factoryClass.newInstance();// 
getDefault.invoke(new Object(), new Object[0]);
+                // Object defFactory = factoryClass.newInstance();// 
getDefault.invoke(new Object(), new Object[0]);
                 // now that we have the factory, there are two different 
createSocket() calls we use,
                 // depending on whether we have a localAddress override.
 
+                Object defFactory = null;
+                try {
+                       defFactory = factoryClass.newInstance();
+                } catch (Throwable t) {
+                       Method getDefault = 
factoryClass.getMethod("getDefault", new Class[0]); //TODO check instantiation 
of socket factory

Review Comment:
   That gives it only more details, else it would be already handled by the 
surrounding try / catch



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to