Skip to content

Commit

Permalink
Minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bmalinowsky committed Jul 14, 2024
1 parent b83bc95 commit f14fbf6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/io/calimero/Connection.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Calimero 2 - A library for KNX network access
Copyright (c) 2015, 2021 B. Malinowsky
Copyright (c) 2015, 2024 B. Malinowsky
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -55,6 +55,13 @@ enum BlockingMode {

void send(T frame, BlockingMode blockingMode) throws KNXException, InterruptedException;

/**
* Returns the name of this connection, a brief textual representation to identify the connection.
* The name does not have to be unique, but should allow distinguishing remote control endpoints for diagnostic,
* logging, and visualization purposes.
*
* @return name for this connection as string
*/
String name();

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/io/calimero/knxnetip/ClientConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ else if (svc == KNXnetIPHeader.CONNECT_RES) {
final ConnectResponse res;
try {
res = new ConnectResponse(data, offset);
} catch (KNXFormatException e) {
} catch (final KNXFormatException e) {
close(CloseEvent.INTERNAL, e.getMessage(), ERROR, null);
throw e;
}
Expand Down
2 changes: 1 addition & 1 deletion src/io/calimero/knxnetip/Discoverer.java
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ private CompletableFuture<Void> search(final InetAddress localAddr, final int lo
}
catch (IOException | RuntimeException e) {
throw new KNXException("search request to " + SYSTEM_SETUP_MULTICAST.getHostAddress() + " failed on "
+ localAddr + ":" + localPort, e);
+ localAddr + ":" + bind.getPort(), e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/io/calimero/knxnetip/DiscovererTcp.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public Result<DescriptionResponse> description() throws KNXException, Interrupte
}
catch (final ExecutionException e) {
final var cause = e.getCause();
if (cause instanceof KNXException exception)
if (cause instanceof final KNXException exception)
throw exception;
if (cause instanceof TimeoutException)
throw new KNXTimeoutException(cause.getMessage());
Expand Down
2 changes: 1 addition & 1 deletion src/io/calimero/knxnetip/KNXnetIPRouting.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public class KNXnetIPRouting extends ConnectionBase
*
* @param netIf specifies the local network interface used to send outgoing multicast datagrams,
* and join the multicast group to receive multicast datagrams,
* use {@code null} for the default interface;
* use {@code null} for the default interface
* @param mcGroup IP multicast address specifying the multicast group this connection shall join,
* use {@link #DefaultMulticast} for the default multicast group;
* value of {@code mcGroup ≥ }{@value #DEFAULT_MULTICAST}
Expand Down
4 changes: 2 additions & 2 deletions src/io/calimero/link/KNXNetworkLinkIP.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Calimero 2 - A library for KNX network access
Copyright (c) 2006, 2023 B. Malinowsky
Copyright (c) 2006, 2024 B. Malinowsky
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -517,7 +517,7 @@ private void doSend(final CEMI msg, final boolean waitForCon)
logger.log(DEBUG, "send {0}{1}", (waitForCon ? "(wait for confirmation) " : ""), msg);
conn.send(msg, waitForCon ? WaitForCon : WaitForAck);

if (msg instanceof CEMILData data)
if (msg instanceof final CEMILData data)
logger.log(TRACE, "send {0}->{1} succeeded", data.getSource(),
data.getDestination());
else
Expand Down

0 comments on commit f14fbf6

Please sign in to comment.