Skip to content

Commit

Permalink
Add final modifiers to final variables
Browse files Browse the repository at this point in the history
Add the final modifier to variables which
are set to a final value.
  • Loading branch information
alexjhawk committed Jan 26, 2021
1 parent 8e594fc commit 9b9ea54
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class EwonUtil {
private static final int defaultReadTimeout = 60000;

/** Log handler */
private static Logger logger = LoggerFactory.getLogger("Ewon.EwonUtil");
private static final Logger logger = LoggerFactory.getLogger("Ewon.EwonUtil");

/** Trust manager used for HTTP connections. Note: Bypasses trust verification. */
private static final TrustManager[] BYPASS_TRUST_MGR =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class GatewayHook extends AbstractGatewayModuleHook {
* Listener for changes in Ewon Connector settings. Invokes {@link this#restart()} to restart the
* connector.
*/
private RecordListenerAdapter<EwonConnectorSettings> settingsListener =
private final RecordListenerAdapter<EwonConnectorSettings> settingsListener =
new RecordListenerAdapter<EwonConnectorSettings>() {
public void recordUpdated(EwonConnectorSettings record) {
logger.info("Settings have been updated. Restarting module.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,25 @@ public class SyncManager {
private static final String CONFIG_EWON_ALL_REALTIME_TAG_NAME = "_config/AllRealtime";

/** Hash set of registered Ewon Connector tags */
private HashSet<String> registeredTags = new HashSet<>();
private final HashSet<String> registeredTags = new HashSet<>();

/** Hash set of registered Ewon Connector Ewons */
private HashSet<String> registeredEwons = new HashSet<>();
private final HashSet<String> registeredEwons = new HashSet<>();

/** Hash set of Ewons to be updated in realtime */
private HashSet<String> realtimeEwons = new HashSet<>();
private final HashSet<String> realtimeEwons = new HashSet<>();

/** Current gateway context */
GatewayContext gatewayContext;
final GatewayContext gatewayContext;

/** Log handler */
Logger logger = LoggerFactory.getLogger("Ewon.EwonSyncManager");
final Logger logger = LoggerFactory.getLogger("Ewon.EwonSyncManager");

/** Current tag provider */
ManagedTagProvider provider;
final ManagedTagProvider provider;

/** Name of current tag provider */
String providerName;
final String providerName;

/** Current communication manager */
CommunicationManger comm;
Expand All @@ -114,7 +114,7 @@ public class SyncManager {
String tagHistoryStore;

/** Cache of last synchronization information, key = ewonId, value = lastSynchroDate */
Map<Integer, Date> lastSyncCache = new HashMap<>();
final Map<Integer, Date> lastSyncCache = new HashMap<>();

/** Boolean if tag history is enabled */
boolean historyEnabled = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/** Ewon Connector communication manager */
public class CommunicationManger {
/** Communication manager logger */
private Logger logger = LoggerFactory.getLogger("Ewon.CommManager");
private final Logger logger = LoggerFactory.getLogger("Ewon.CommManager");

/** JSON string and object serialization library */
private final Gson gson = new Gson();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
public class EwonConnectorSettings extends PersistentRecord {
/** Record meta information for Ewon Connector */
public static RecordMeta<EwonConnectorSettings> META =
public static final RecordMeta<EwonConnectorSettings> META =
new RecordMeta<>(EwonConnectorSettings.class, "ewonConnectorSettings");

/** Ewon Connector identifier */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class EwonsData extends DMResult {
boolean moreDataAvailable = false;

/** Transaction identifier */
Long transactionId = 0L;
final Long transactionId = 0L;

/**
* Get array of every Ewon's data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/** Class representation of a result from Talk2M */
public class TMResult {
/** Hash map of tag values in result */
HashMap<String, String> TagValues;
final HashMap<String, String> TagValues;

/** Number of columns in Talk2M response */
static final int NUM_COLUMNS = 6;
Expand Down

0 comments on commit 9b9ea54

Please sign in to comment.