Skip to content

Commit 15c5af4

Browse files
committed
1 parent 532f1fd commit 15c5af4

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

modules/core-module/src/main/java/org/simplejavamail/api/mailer/config/TransportStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public String propertyNameSSLTrust() {
173173
*/
174174
@Override
175175
public String propertyNameCheckServerIdentity() {
176-
throw new AssertionError("This property is not relevant for plain SMTP");
176+
throw new IllegalStateException("This property is not relevant for plain SMTP");
177177
}
178178

179179
/**

modules/core-module/src/main/java/org/simplejavamail/internal/util/CertificationUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static X509Certificate readFromPem(InputStream pemData)
3636
Class<Provider> bouncyCastleClass = (Class<Provider>) forName(BOUNCY_CASTLE_PROVIDER_CLASS);
3737
Security.addProvider(getProvider(bouncyCastleClass));
3838
} catch (ClassNotFoundException e) {
39-
throw new AssertionError(format("Class found but also not found??? (%s)", BOUNCY_CASTLE_PROVIDER_CLASS));
39+
throw new IllegalStateException(format("Class found but also not found??? (%s)", BOUNCY_CASTLE_PROVIDER_CLASS));
4040
}
4141
} else {
4242
throw new SmimeSupportMissingException();

modules/core-module/src/main/java/org/simplejavamail/internal/util/SimpleConversions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static Boolean convertToBoolean(@Nullable final Object value) {
3939
} else if (strValue.equalsIgnoreCase("false") || strValue.equalsIgnoreCase("0")) {
4040
return false;
4141
}
42-
throw new AssertionError("Wrong property must have been requested");
42+
throw new IllegalArgumentException("Wrong property must have been requested");
4343
}
4444
}
4545
}

modules/simple-java-mail/src/main/java/org/simplejavamail/converter/EmailConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ public static MimeMessage emailToMimeMessage(@NotNull final Email email, @NotNul
428428
return MimeMessageProducerHelper.produceMimeMessage(checkNonEmptyArgument(email, "email"), checkNonEmptyArgument(session, "session"));
429429
} catch (UnsupportedEncodingException | MessagingException e) {
430430
// this should never happen, so we don't acknowledge this exception (and simply bubble up)
431-
throw new AssertionError(e.getMessage(), e);
431+
throw new IllegalStateException(e.getMessage(), e);
432432
}
433433
}
434434

@@ -510,7 +510,7 @@ public static String mimeMessageToEML(@NotNull final MimeMessage mimeMessage) {
510510
return os.toString(UTF_8.name());
511511
} catch (IOException | MessagingException e) {
512512
// this should never happen, so we don't acknowledge this exception (and simply bubble up)
513-
throw new AssertionError("This should never happen", e);
513+
throw new IllegalStateException("This should never happen", e);
514514
}
515515
}
516516

modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public String toString() {
5757
try {
5858
return "MimeMessage<id:" + super.getMessageID() + ", subject:" + super.getSubject() + ">";
5959
} catch (MessagingException e) {
60-
throw new AssertionError("should not reach here");
60+
throw new IllegalStateException("should not reach here");
6161
}
6262
}
6363
};

modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageProducerHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ public static MimeMessage produceMimeMessage(@NotNull Email email, @NotNull Sess
4040
return mimeMessageProducer.populateMimeMessage(email, session);
4141
}
4242
}
43-
throw new AssertionError("no compatible MimeMessageProducer found for email");
43+
throw new IllegalStateException("no compatible MimeMessageProducer found for email");
4444
}
4545
}

modules/simple-java-mail/src/main/java/org/simplejavamail/internal/modules/ModuleLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static SMIMEModule loadSmimeModule() {
6868

6969
public static BatchModule loadBatchModule() {
7070
if (FORCED_DISABLED_MODULES.contains(BatchModule.class)) {
71-
throw new AssertionError("BatchModule forcefully disabled");
71+
throw new IllegalStateException("BatchModule forcefully disabled");
7272
}
7373
if (!LOADED_MODULES.containsKey(BatchModule.class)) {
7474
LOADED_MODULES.put(BatchModule.class, loadModule(

modules/simple-java-mail/src/main/java/org/simplejavamail/mailer/internal/MailerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ public final AsyncResponse sendMail(final Email email, @SuppressWarnings("SamePa
319319
.executeAsync(operationalConfig.getExecutorService(), "sendMail process", sendMailClosure);
320320
}
321321
}
322-
throw new AssertionError("Email not valid, but no MailException was thrown for it");
322+
throw new IllegalStateException("Email not valid, but no MailException was thrown for it");
323323
}
324324

325325
/**

0 commit comments

Comments
 (0)