Skip to content

Commit 35241ba

Browse files
committed
fixed lambda problems with non final field
1 parent 0f70523 commit 35241ba

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

IoTDBJDBC/src/main/java/com/oracle/demo/timg/iot/iotdbjdbc/messagehandler/filters/DeviceModelMessageFilterCore.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,16 @@ public boolean doesIoTDataCoreMatchModel(IoTDataCore input) throws Exception {
181181
}
182182
log.fine(() -> "instance is unknown retrieving its model, " + instanceId);
183183
// we don't know about it, using the device ID query the DB to get the model id
184-
String instanceModelId;
184+
String instanceModelIdTemp = null;
185185
try {
186-
instanceModelId = getModelIdFromInstanceId(instanceId);
186+
instanceModelIdTemp = getModelIdFromInstanceId(instanceId);
187187
} catch (SQLException e) {
188188
log.warning("SQLException locating instances model id for model " + instanceId + ", "
189189
+ e.getLocalizedMessage());
190-
instanceModelId = null;
191190
}
192-
// can't use a lambda here as instanceModelId is
191+
// can't use a lambda for the debugging unless we do this as instanceModelId
192+
// must be final
193+
String instanceModelId = instanceModelIdTemp;
193194
log.fine("instance has model id, " + instanceModelId);
194195
if (instanceModelId == null) {
195196
// no model id found, this I guess is possible for an instance that is not

0 commit comments

Comments
 (0)