Fix Java concoredocker to match Python behavior#219
Fix Java concoredocker to match Python behavior#219avinxshKD wants to merge 3 commits intoControlCore-Project:devfrom
Conversation
9619d47 to
4cd4b59
Compare
|
@pradeeban recreated the fix for #197 as asked. Bcz commits cancled eatch other before, plks review thanks |
concoredocker.java
Outdated
| maxtime = ((List<?>) literalEval(content)).size(); | ||
| } catch (IOException e) { | ||
| maxtime = ((Number) literalEval(content)).intValue(); | ||
| } catch (Exception e) { |
There was a problem hiding this comment.
Why is this exception changed to a generic one? If you anticipate more than IOException, please create more targeted exceptions, rather than replacing IOException with the generic Exception.
a33b12f to
c9706e5
Compare
|
@pradeeban hey hve updated the catch block to use targeted exceptions: These cover: file read errors, parsing failures, and type cast issues. Does this look good? or would you prefer a different approach? Also, the CI tests are failing on |
Fix Java implementation to match Python behavior
The Java version had several bugs that broke core functionality - read() only returned one value instead of the full array, write() used the wrong timestamp variable, defaultMaxTime() was trying to cast a bare integer to a List, and unchanged() didn't return anything.
Also added the missing simtime field that Python tracks globally and removed the System.exit(1) call that would crash the whole container on bad input.
Fixes #197