Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #389 +/- ##
==========================================
- Coverage 91.8% 91.8% -0.1%
- Complexity 2230 2233 +3
==========================================
Files 211 211
Lines 5942 5949 +7
Branches 807 809 +2
==========================================
+ Hits 5458 5464 +6
- Misses 230 231 +1
Partials 254 254 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
If the end marker of a protected region directly followed the start marker, the computed substring indices overlapped and the MDSL generator failed with a StringIndexOutOfBoundsException. The reader also assumed the platform line separator, which broke files with other line endings. The content between the markers is now determined via the line breaks actually present in the file; an empty region returns an empty string.
stefan-ka
force-pushed
the
fix/219-empty-protected-region
branch
from
October 20, 2026 21:55
1e26ada to
2c684ad
Compare
This file contains hidden or 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
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.
Fixes the exception reported in #219.
Cause
ProtectedRegionReader.getProtectedRegionContentcomputed the region content assubstring(start + startMarker.length() + lineSeparator, end - lineSeparator).StringIndexOutOfBoundsException.System.lineSeparator(); MDSL files with other line endings (e.g. CRLF on Linux, LF on Windows) were cut wrongly.Fix
The content is now taken from after the line break of the start line up to the line break before the end marker, using the line breaks actually present in the file (
\nor\r\n). An empty region returns"". Content and behavior for regular regions are unchanged (existing tests pass).As before, the generator omits a region whose content is empty (the template checks
?has_content); that's the "region disappears" observation in the issue comments and is not changed here.Tests
New tests in
ProtectedRegionReaderTest: empty region, region with only an empty line, CRLF line endings. Without the fix, the empty-region and CRLF tests fail; with the fix all 67 MDSL/protected-region tests pass.Not addressed
The comment about line breaks in vision statements producing invalid MDSL is a separate problem.
Based on
masterplus the Gradle/Jacoco build fix from #383 (cherry-picked), so it can be merged independently.