Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/16964#discussion_r101634185
--- Diff:
common/network-common/src/test/java/org/apache/spark/network/crypto/AuthIntegrationSuite.java
---
@@ -163,20 +163,17 @@ void createServer(String secret) throws Exception {
}
void createServer(String secret, boolean enableAes) throws Exception {
- TransportServerBootstrap introspector = new
TransportServerBootstrap() {
- @Override
- public RpcHandler doBootstrap(Channel channel, RpcHandler
rpcHandler) {
- AuthTestCtx.this.serverChannel = channel;
- if (rpcHandler instanceof AuthRpcHandler) {
- AuthTestCtx.this.authRpcHandler = (AuthRpcHandler) rpcHandler;
- }
- return rpcHandler;
+ TransportServerBootstrap introspector = (channel, rpcHandler) -> {
+ this.serverChannel = channel;
+ if (rpcHandler instanceof AuthRpcHandler) {
+ this.authRpcHandler = (AuthRpcHandler) rpcHandler;
}
+ return rpcHandler;
};
SecretKeyHolder keyHolder = createKeyHolder(secret);
TransportServerBootstrap auth = enableAes ? new
AuthServerBootstrap(conf, keyHolder)
: new SaslServerBootstrap(conf, keyHolder);
- this.server = ctx.createServer(Lists.newArrayList(auth,
introspector));
+ this.server = ctx.createServer(Arrays.asList(auth, introspector));
--- End diff --
I also think we can do away with things like Lists.newArrayList, which used
to be a much more concise ways of making a list of things, but by Java 7, is
just a non-standard version of the identical Arrays.asList
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]