Skip to content

Commit

Permalink
Illegal reflective access by com.sun.mail.util.SocketFetcher eclipse-…
Browse files Browse the repository at this point in the history
…ee4j#124

Co-authored-by: jmehrens <[email protected]>
Co-authored-by: icu5545 <[email protected]>
Signed-off-by: jmehrens <[email protected]>
  • Loading branch information
jmehrens committed Feb 14, 2024
1 parent 0d034ca commit a4a8d59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,11 @@ private static HostnameVerifier getHostnameVerifier(Properties props, String pre
}

//Everything failed, try to expose one of the reasons.
Class<?> c = Class.forName(fqcn)
verifierClass = Class.forName(fqcn)
.asSubclass(HostnameVerifier.class);
//This is unexpected, should be unreachable
throw new ClassNotFoundException(fqcn,
new IllegalStateException(c.toString())); //unexpected
new IllegalStateException(verifierClass.toString()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ private void testSSLHostnameVerifier(boolean acceptConnections) throws Exception
synchronized (TestHostnameVerifier.class) {
try {
runnable.run();
} catch(Throwable t){
} catch (Throwable t){
throw new AssertionError(t);
} finally{
} finally {
TestHostnameVerifier.reset();
}
}
Expand Down Expand Up @@ -360,7 +360,7 @@ public void testSSLHostnameVerifierRemovedAlias() {
testSSLHostnameVerifierClass("localhost", "foobarbaz");
throw new AssertionError("No exception");
} catch (MessagingException me) {
assertFalse("Must not class load aliases",
assertFalse("Must not attempt to class load aliases",
isFromClassLoading(me));
} catch(Exception e) {
throw new AssertionError(e);
Expand Down

0 comments on commit a4a8d59

Please sign in to comment.