File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
modules/simple-java-mail/src/main/java/org/simplejavamail/internal/modules Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1010import static java .lang .String .format ;
1111
1212public class ModuleLoader {
13-
13+
14+ private static final boolean BATCH_SUPPORT_CLASS_AVAILABLE = MiscUtil .classAvailable ("org.simplejavamail.internal.batchsupport.BatchSupport" );
15+ private static final boolean SMIME_SUPPORT_CLASS_AVAILABLE = MiscUtil .classAvailable ("org.simplejavamail.internal.smimesupport.SMIMESupport" );
1416 private static final Map <Class , Object > LOADED_MODULES = new HashMap <>();
1517
1618 // used from junit tests
@@ -82,11 +84,11 @@ public static BatchModule loadBatchModule() {
8284 }
8385
8486 public static boolean batchModuleAvailable () {
85- return !FORCED_DISABLED_MODULES .contains (BatchModule .class ) && MiscUtil . classAvailable ( "org.simplejavamail.internal.batchsupport.BatchSupport" ) ;
87+ return !FORCED_DISABLED_MODULES .contains (BatchModule .class ) && BATCH_SUPPORT_CLASS_AVAILABLE ;
8688 }
8789
8890 public static boolean smimeModuleAvailable () {
89- return !FORCED_DISABLED_MODULES .contains (SMIMEModule .class ) && MiscUtil . classAvailable ( "org.simplejavamail.internal.smimesupport.SMIMESupport" ) ;
91+ return !FORCED_DISABLED_MODULES .contains (SMIMEModule .class ) && SMIME_SUPPORT_CLASS_AVAILABLE ;
9092 }
9193
9294 @ SuppressWarnings ("unchecked" )
You can’t perform that action at this time.
0 commit comments