GitLab update scheduled for Friday, October 22th between 08:15 and 08:45 CEST. If unpleasant, please contact René or Martin.

Commit 7d23e49c authored by René Schöne's avatar René Schöne
Browse files

Fix duplicate variable declaration for two active protocols.

parent 2ae8767e
......@@ -7,33 +7,32 @@ public boolean {{parentTypeName}}.{{connectMethod}}(String {{connectParameterNam
{{/loggingEnabledForReads}}
set{{tokenName}}({{lastResult}});
};
ConnectToken connectToken;
switch (scheme) {
{{#usesMqtt}}
case "mqtt":
ConnectToken connectToken = {{mqttHandlerAttribute}}().newConnection(uri, consumer);
connectToken = {{mqttHandlerAttribute}}().newConnection(uri, consumer);
if (connectToken == null) {
return false;
}
connectTokens.computeIfAbsent(this, astNode -> new java.util.HashMap<java.net.URI, ConnectToken>())
.put(uri, connectToken);
break;
{{/usesMqtt}}
{{#usesRest}}
case "rest":
ConnectToken connectToken = {{restHandlerAttribute}}().newPUTConnection(uri, input -> {
connectToken = {{restHandlerAttribute}}().newPUTConnection(uri, input -> {
consumer.accept(input.getBytes());
});
if (connectToken == null) {
return false;
}
connectTokens.computeIfAbsent(this, astNode -> new java.util.HashMap<java.net.URI, ConnectToken>())
.put(uri, connectToken);
break;
{{/usesRest}}
default:
System.err.println("Unknown protocol '" + scheme + "'.");
return false;
}
connectTokens.computeIfAbsent(this, astNode -> new java.util.HashMap<java.net.URI, ConnectToken>())
.put(uri, connectToken);
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment