necouchman commented on a change in pull request #360: GUACAMOLE-524: Update
connect() API changes for backward compatibility with 1.0.0.
URL: https://github.com/apache/guacamole-client/pull/360#discussion_r249741779
##########
File path:
guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Connectable.java
##########
@@ -54,8 +97,13 @@
* If an error occurs while connecting to guacd, or if permission to
* connect is denied.
*/
- public GuacamoleTunnel connect(GuacamoleClientInformation info,
- Map<String, String> tokens) throws GuacamoleException;
+ default GuacamoleTunnel connect(GuacamoleClientInformation info,
+ Map<String, String> tokens) throws GuacamoleException {
+
+ // Allow old implementations of Connectable to continue to work
+ return this.connect(info);
Review comment:
Is there a reason supplying a default of this particular instance of this
method is necessary or valuable? Won't the old implementations already be
calling the other default method, without the `tokens` parameter? And doesn't
this introduce the possibility that an implementing class could end up
recursively calling these parameters (if they don't actually implement either
of them)? Or will that get caught at compile time?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services