look it's a bugfix!

This commit is contained in:
rusefillc 2022-04-17 18:11:32 -04:00
parent 1d9af6ef1f
commit 53f7d2e16e
2 changed files with 29 additions and 31 deletions

View File

@ -25,11 +25,7 @@ public class JavaSensorsConsumer implements ConfigurationConsumer {
ConfigField configField = iterator.cf;
ConfigField next = iterator.next;
if (configField.isBit()) {
// do not support bits for now but need to account for size
tsPosition += configField.getSize(next);
return tsPosition;
}
if (!configField.isBit()) {
sb.append(configField.getName()).append("(");
String string = readerState.variableRegistry.applyVariables(configField.getComment());
@ -56,8 +52,10 @@ public class JavaSensorsConsumer implements ConfigurationConsumer {
sb.append("\n");
}
tsPosition += configField.getSize(next);
// this value would be consumed by UsagesReader
// todo: too many variables that's fragile shall we move tsPosition to iterator state?
sensorTsPosition = tsPosition;
return tsPosition;

View File

@ -53,6 +53,6 @@ public class JavaSensorsConsumerTest {
JavaSensorsConsumer javaSensorsConsumer = new JavaSensorsConsumer();
state.readBufferedReader(outputChannels, javaSensorsConsumer);
assertEquals(0, javaSensorsConsumer.sensorTsPosition);
assertEquals(4, javaSensorsConsumer.sensorTsPosition);
}
}