Skip to content

Commit

Permalink
review finding: removed all final var statements
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerfriedrich committed Apr 10, 2023
1 parent 5083a25 commit c2eb9b7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private synchronized boolean connect() {
state = ClientState.RUNNING;
return true;
} catch (InterruptedException e) {
final var lastState = state;
ClientState lastState = state;
state = ClientState.INTERRUPTED;

logger.trace("Bridge {}, connection interrupted", thingUID);
Expand Down Expand Up @@ -458,7 +458,7 @@ public final void unregisterGroupAddressListener(GroupAddressListener listener)

@Override
public boolean isConnected() {
final var tmpLink = link;
KNXNetworkLink tmpLink = link;
return tmpLink != null && tmpLink.isOpen();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,12 +505,12 @@ protected void attachToClient() {
}

protected void detachFromClient() {
final var pollingJobSynced = pollingJob;
ScheduledFuture<?> pollingJobSynced = pollingJob;
if (pollingJobSynced != null) {
pollingJobSynced.cancel(true);
pollingJob = null;
}
final var descriptionJobSynced = descriptionJob;
ScheduledFuture<?> descriptionJobSynced = descriptionJob;
if (descriptionJobSynced != null) {
descriptionJobSynced.cancel(true);
descriptionJob = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void initializeLater() {
if (!config.getLocalIp().isEmpty()) {
localEndPoint = new InetSocketAddress(config.getLocalIp(), 0);
} else {
final var localNetworkAddressService = networkAddressService;
NetworkAddressService localNetworkAddressService = networkAddressService;
if (localNetworkAddressService == null) {
logger.debug("NetworkAddressService not available, cannot create bridge {}", thing.getUID());
updateStatus(ThingStatus.OFFLINE);
Expand All @@ -187,7 +187,7 @@ public void initializeLater() {
secureTunnel.user, secureTunnel.userKey, thing.getUID(), config.getResponseTimeout(),
config.getReadingPause(), config.getReadRetriesLimit(), getScheduler(), this);

final var tmpClient = client;
IPClient tmpClient = client;
if (tmpClient != null) {
tmpClient.initialize();
}
Expand All @@ -197,7 +197,7 @@ public void initializeLater() {

@Override
public void dispose() {
final var tmpInitJob = initJob;
Future<?> tmpInitJob = initJob;
if (tmpInitJob != null) {
while (!tmpInitJob.isDone()) {
logger.trace("Bridge {}, shutdown during init, trying to cancel", thing.getUID());
Expand All @@ -210,7 +210,7 @@ public void dispose() {
}
initJob = null;
}
final var tmpClient = client;
IPClient tmpClient = client;
if (tmpClient != null) {
tmpClient.dispose();
client = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ public void initialize() {
}

public void initializeLater() {
final var tmpClient = client;
SerialClient tmpClient = client;
if (tmpClient != null) {
tmpClient.initialize();
}
}

@Override
public void dispose() {
final var tmpInitJob = initJob;
Future<?> tmpInitJob = initJob;
if (tmpInitJob != null) {
if (!tmpInitJob.isDone()) {
logger.trace("Bridge {}, shutdown during init, trying to cancel", thing.getUID());
Expand All @@ -87,7 +87,7 @@ public void dispose() {
initJob = null;
}

final var tmpClient = client;
SerialClient tmpClient = client;
if (tmpClient != null) {
tmpClient.dispose();
client = null;
Expand Down

0 comments on commit c2eb9b7

Please sign in to comment.