Bug in Edge2Edge in ModbusType Float64 fixed.
Fixed Typo: Changed UnsignedQuadrupleWordElement to FloatQuadrupleWordElement.
Thanks a lot for this bug fix. I have a wish here; Can you please use new java 17 features here; in that case for switch case format like; return switch (type) { case UINT16, ENUM16 -> new UnsignedWordElement(address); case UINT32 -> new UnsignedDoublewordElement(address); case FLOAT32 -> new FloatDoublewordElement(address); case FLOAT64 -> new UnsignedQuadruplewordElement(address); case STRING16 -> new StringWordElement(address, 16); }; Thanks a lot.
Hi Huseyin, thanks for your comment. I have done the needful :-)
yep I have seen it. One return before switch case is enough and in my opinion we dont need this curly braces anymore. and we can use the default to return null back. Can you please check it again.
I would so write it;
private static AbstractModbusElement<?> generateModbusElement(ModbusType type, int address) {
return switch (type) {
case UINT16, ENUM16 -> new UnsignedWordElement(address);
case UINT32 -> new UnsignedDoublewordElement(address);
case FLOAT32 -> new FloatDoublewordElement(address);
case FLOAT64 -> new FloatQuadruplewordElement(address);
case STRING16 -> new StringWordElement(address, 16);
default -> null;
};
}
yep I have seen it. One return before switch case is enough and in my opinion we dont need this curly braces anymore. and we can use the default to return null back. Can you please check it again.
I would so write it;
private static AbstractModbusElement<?> generateModbusElement(ModbusType type, int address) { return switch (type) { case UINT16, ENUM16 -> new UnsignedWordElement(address); case UINT32 -> new UnsignedDoublewordElement(address); case FLOAT32 -> new FloatDoublewordElement(address); case FLOAT64 -> new FloatQuadruplewordElement(address); case STRING16 -> new StringWordElement(address, 16); default -> null; }; }
Oh, I see. I will update in a minute. Haven't got used to the new switch-case format.
yep I have seen it. One return before switch case is enough and in my opinion we dont need this curly braces anymore. and we can use the default to return null back. Can you please check it again. I would so write it;
private static AbstractModbusElement<?> generateModbusElement(ModbusType type, int address) { return switch (type) { case UINT16, ENUM16 -> new UnsignedWordElement(address); case UINT32 -> new UnsignedDoublewordElement(address); case FLOAT32 -> new FloatDoublewordElement(address); case FLOAT64 -> new FloatQuadruplewordElement(address); case STRING16 -> new StringWordElement(address, 16); default -> null; }; }Oh, I see. I will update in a minute. Haven't got used to the new switch-case format.
👍🏻 Thanks a lot. I ll approve and inform Stefan.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Additional details and impacted files
@@ Coverage Diff @@
## develop #2265 +/- ##
=============================================
+ Coverage 58.48% 58.49% +0.01%
Complexity 159 159
=============================================
Files 2544 2544
Lines 108999 108999
Branches 8028 8028
=============================================
+ Hits 63740 63748 +8
+ Misses 42921 42915 -6
+ Partials 2338 2336 -2
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@sfeilmeier This PR is pretty old. Is there a specific reason for not merging it or did iit get lost in the crowd of PRs? Without this the Edge2EdgeEss will not work. If there is no specific reason we would add the missing Junit tests in the next week.