Skip to content

Commit 1246cd5

Browse files
committed
Change syntax to avoid javac 8 compilation errors
It seems like neither Eclipse ecj nor javac in Java 11 complains when using constructor references in these very special cases used for unit testing. But javac in Java 8 does. So, we're now using lambda expressions in place of constructor references: this seems to make all compilers happy.
1 parent 097553b commit 1246cd5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

toolkit/src/test/java/com/onelogin/saml2/test/AuthTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,7 +2257,7 @@ public AuthnRequestEx(Saml2Settings sett, AuthnRequestParams par) {
22572257
}
22582258

22592259
Auth auth = new Auth(settings, request, response);
2260-
auth.setAuthnRequestFactory(AuthnRequestEx::new);
2260+
auth.setAuthnRequestFactory((sett, param) -> new AuthnRequestEx(sett, param));
22612261
auth.login(params);
22622262
}
22632263

@@ -2289,7 +2289,7 @@ public SamlResponseEx(Saml2Settings sett, HttpRequest req) throws Exception {
22892289
}
22902290

22912291
Auth auth = new Auth(settings, request, response);
2292-
auth.setSamlResponseFactory(SamlResponseEx::new);
2292+
auth.setSamlResponseFactory((sett, req) -> new SamlResponseEx(sett, req));
22932293
auth.processResponse();
22942294
}
22952295

@@ -2320,7 +2320,7 @@ public LogoutRequestEx(Saml2Settings sett, LogoutRequestParams par) {
23202320
}
23212321

23222322
Auth auth = new Auth(settings, request, response);
2323-
auth.setOutgoingLogoutRequestFactory(LogoutRequestEx::new);
2323+
auth.setOutgoingLogoutRequestFactory((sett, param) -> new LogoutRequestEx(sett, param));
23242324
auth.logout(null, params);
23252325
}
23262326

@@ -2355,7 +2355,7 @@ public LogoutRequestEx(Saml2Settings sett, HttpRequest req) {
23552355
}
23562356

23572357
Auth auth = new Auth(settings, request, response);
2358-
auth.setReceivedLogoutRequestFactory(LogoutRequestEx::new);
2358+
auth.setReceivedLogoutRequestFactory((sett, req) -> new LogoutRequestEx(sett, req));
23592359
auth.processSLO();
23602360
}
23612361

@@ -2425,7 +2425,7 @@ public LogoutResponseEx(Saml2Settings sett, HttpRequest req) {
24252425
}
24262426

24272427
Auth auth = new Auth(settings, request, response);
2428-
auth.setReceivedLogoutResponseFactory(LogoutResponseEx::new);
2428+
auth.setReceivedLogoutResponseFactory((sett, req) -> new LogoutResponseEx(sett, req));
24292429
auth.processSLO();
24302430
}
24312431
}

0 commit comments

Comments
 (0)