-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/cod open close #389
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…lose # Conflicts: # rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/ast/statements.kt # rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/parsing/parsetreetoast/misc.kt
lanarimarco
requested changes
Jan 8, 2024
rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/DBFileMap.kt
Show resolved
Hide resolved
rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/internal_interpreter.kt
Outdated
Show resolved
Hide resolved
rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/internal_interpreter.kt
Outdated
Show resolved
Hide resolved
rpgJavaInterpreter-core/src/test/kotlin/com/smeup/rpgparser/db/OpenCloseTest.kt
Outdated
Show resolved
Hide resolved
- Rename test T51_A01.rpgle as OPEN_CLOSE.rpgle - Delete unnecessary vars in OPEN_CLOSE.rpgle - dbFileMap defined only in InterpreterStatus class
- Rename test T51_A01.rpgle as OPEN_CLOSE.rpgle - Delete unnecessary vars in OPEN_CLOSE.rpgle - dbFileMap defined only in InterpreterStatus class
- Resolved error in OPEN_CLOSE.rpgle
lanarimarco
reviewed
Jan 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a proposal about EnrichedDBFile.state
To me is ok also your approach.
Il giorno lun 8 gen 2024 alle ore 16:24 Dario Foresti <
***@***.***> ha scritto:
… ***@***.**** commented on this pull request.
------------------------------
In
rpgJavaInterpreter-core/src/main/kotlin/com/smeup/rpgparser/interpreter/DBFileMap.kt
<#389 (comment)>:
> @@ -64,6 +64,9 @@ class DBFileMap {
* */
data class EnrichedDBFile(private val dbFile: DBFile, private val fileDefinition: FileDefinition, val jarikoMetadata: FileMetadata) : DBFile {
+ // All files are opened by default when defined in F specs.
+ var open = true
already had implemented a solution similar to yours, with this new
function defined in class EnrichedDbFile
private fun checkOpened(): DBFile {
require(open) {
"Cannot access to closed file $name"
}
return dbFile
}
and DBFile methods override calls like this
override fun write(record: Record) = checkOpened().write(record).validate()
I'm not a fan of extension function...
—
Reply to this email directly, view it on GitHub
<#389 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJR622VL2CAAQ4HX6P64QCDYNQFTFAVCNFSM6AAAAABBRE5AJKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQMBZGM2DSOBRGM>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
--
[image: smeup] <https://www.smeup.com>
Marco Lanari
R&D Department - Developer
Office: 0521940611 <00390521940611>
www.smeup.com
*SMEUP LAB SRL*
Via Carra, 8 - 43122 Parma (PR)
|
- Check file open condition on access functions calls.
lanarimarco
approved these changes
Jan 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Implementation of OPEN and CLOSE statements and %OPEN function.
Related to:
MULANGGT90 T53_A01-P01
Checklist:
./gradlew ktlintCheck
)./gradlew check
)docs
directory