Skip to content

Conversation

yutaro-sakamoto
Copy link
Contributor

@yutaro-sakamoto yutaro-sakamoto commented Sep 10, 2025

This pull request primarily renames the indexed-lock test suite to file-lock throughout the codebase, updates all related references, and makes several improvements to file locking and file handling logic in the Java implementation. Additionally, it cleans up and standardizes test dependencies and scripts.

Test suite renaming and updates:

  • Renamed the indexed-lock test suite and all related files, directories, and references to file-lock in test scripts, Makefiles, and .gitignore for consistency and clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18]
  • Add new test suites of file locking of SEQUENTIAL, LINE SEQUENTIAL and RELATIVE files to tests/file-lock.src/lock-file.at. This file also contains test suites of locking of INDEXED files, which we created when releasing 1.1.12.
    • The new tests of locking SEQUENTIAL, LINE SEQUENTIAL and RELATIVE files guarantees that file status code is identical to ones of opensource COBOL.
  • Updated CI workflow files (.github/workflows/coverage.yml, pull-request.yml, push.yml). [1] [2] [3] [4] [5]

Java file handling and locking improvements:

  • In CobolFile.java and CobolRelativeFile.java, renamed the file lock flag variable to isSharedLock for clarity and replaced all usages accordingly. [1] [2]
  • In CobolRelativeFile.java, improved file handling for output mode by resetting file length and position after opening, and removed redundant file deletion logic. [1] [2]
    • The reason why I removed file deletion logic is that file deletion logic removes the file even if the file is locked.
  • Set the FileLock object in the FileIO class when opening files, ensuring proper lock management.

Dependency and import cleanup:

  • Removed an unused import (Path) from CobolRelativeFile.java.

These changes collectively improve the clarity, maintainability, and correctness of the file locking tests and related code.

@yutaro-sakamoto yutaro-sakamoto marked this pull request as ready for review September 10, 2025 02:33
@Copilot Copilot AI review requested due to automatic review settings September 10, 2025 02:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request renames the indexed-lock test suite to file-lock throughout the codebase and makes improvements to file locking logic in the Java implementation. The changes also add comprehensive file locking tests for SEQUENTIAL, LINE SEQUENTIAL, and RELATIVE file types to ensure compatibility with standard COBOL behavior.

  • Systematically renames indexed-lock to file-lock across test files, build scripts, and CI workflows
  • Improves file locking variable naming for clarity (lockFlagisSharedLock)
  • Adds comprehensive file locking tests for SEQUENTIAL, LINE SEQUENTIAL, and RELATIVE files
  • Fixes file handling logic for RELATIVE files in output mode

Reviewed Changes

Copilot reviewed 21 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/file-lock.src/*.at Updates file paths from indexed-lock to file-lock for Java synchronization modules
tests/file-lock.src/lock-file.at Adds new comprehensive file locking tests for multiple file organization types
tests/file-lock.at Updates main test suite name and includes new lock-file tests
tests/Makefile.* Updates build configuration to use file-lock instead of indexed-lock
tests/.gitignore Updates ignored files to use new file-lock naming
libcobj/.../FileIO.java Sets FileLock object in setRandomAccessFile method
libcobj/.../CobolRelativeFile.java Improves variable naming and file handling for output mode
libcobj/.../CobolFile.java Renames lock flag variable for clarity
.github/workflows/*.yml Updates CI workflows to use file-lock test suite name

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yutaro-sakamoto yutaro-sakamoto requested review from tsh-hashimoto and removed request for tsh-hashimoto September 10, 2025 02:49
@yutaro-sakamoto yutaro-sakamoto marked this pull request as draft September 10, 2025 05:18
@yutaro-sakamoto yutaro-sakamoto marked this pull request as ready for review September 10, 2025 06:26
@yutaro-sakamoto yutaro-sakamoto merged commit 7dd4367 into opensourcecobol:develop Sep 12, 2025
145 checks passed
@yutaro-sakamoto yutaro-sakamoto mentioned this pull request Sep 29, 2025
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