Skip to content

Commit

Permalink
Glassfish can throw IllegalStateException
Browse files Browse the repository at this point in the history
Signed-off-by: jmehrens <[email protected]>
  • Loading branch information
jmehrens committed Nov 22, 2023
1 parent 683898d commit 88a791e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/src/main/java/jakarta/mail/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -1441,8 +1441,8 @@ private static Class<?>[] getHk2ServiceLoaderTargets(Class<?> factoryClass) {
if (loader != null) {
try {
classes[w++] = Class.forName("org.glassfish.hk2.osgiresourcelocator.ServiceLoader", false, loader);
} catch (ClassNotFoundException | LinkageError ignored) {
}
} catch (Exception | LinkageError ignored) {
} //GlassFish class loaders can throw undocumented exceptions
}
}

Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/jakarta/mail/util/FactoryFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ private static Class<?>[] getHk2ServiceLoaderTargets(Class<?> factoryClass) {
if (loader != null) {
try {
classes[w++] = Class.forName("org.glassfish.hk2.osgiresourcelocator.ServiceLoader", false, loader);
} catch (ClassNotFoundException | LinkageError ignored) {
}
} catch (Exception | LinkageError ignored) {
} //GlassFish class loaders can throw undocumented exceptions
}
}

Expand Down

0 comments on commit 88a791e

Please sign in to comment.