Skip to content

Fix Java concoredocker to match Python behavior#219

Open
avinxshKD wants to merge 3 commits intoControlCore-Project:devfrom
avinxshKD:enhance-java-concoredocker
Open

Fix Java concoredocker to match Python behavior#219
avinxshKD wants to merge 3 commits intoControlCore-Project:devfrom
avinxshKD:enhance-java-concoredocker

Conversation

@avinxshKD
Copy link

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

@avinxshKD avinxshKD force-pushed the enhance-java-concoredocker branch from 9619d47 to 4cd4b59 Compare February 8, 2026 07:05
@avinxshKD
Copy link
Author

@pradeeban recreated the fix for #197 as asked. Bcz commits cancled eatch other before,

plks review thanks

maxtime = ((List<?>) literalEval(content)).size();
} catch (IOException e) {
maxtime = ((Number) literalEval(content)).intValue();
} catch (Exception e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@avinxshKD avinxshKD force-pushed the enhance-java-concoredocker branch from a33b12f to c9706e5 Compare February 9, 2026 06:38
@avinxshKD
Copy link
Author

@pradeeban hey hve updated the catch block to use targeted exceptions:
} catch (IOException | ClassCastException | NumberFormatException e) {

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 test_run_command_from_project_dirin
test_cli.py , this seems to be a pre-existing issue unrelated to the Java changes.
Should I investigate that separately? pls let me know Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants