Skip to content
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

SimpleBinaryBufferedReaderFactory misses line endings #811

Closed
spring-projects-issues opened this issue Feb 4, 2019 · 0 comments
Closed
Labels
for: backport-to-5.0.x Issues that will be back-ported to the 5.0.x line for: backport-to-5.1.x Issues that will be back-ported to the 5.1.x line in: infrastructure type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

cosban opened BATCH-2792 and commented

If a line contains the first character of the line delimiter within N characters of the actual beginning of the line ending delimiter, where N is the length of the line ending delimiter, then the SimpleBinaryBufferedReaderFactory will incorrectly miss the actual line ending and continue reading.

The '#' character is within 5 characters of the actual line ending for this example. This causes the candidateEnding to contain #3#@# before determining that it is not the correct line ending, appending all of these characters to the line buffer, and continuing.
I suspect it would be better for the method to fail fast the moment that current candidate doesn't match the provided template. i.e. once #3 is determined to not be a possible match of the template going forward.

I have provided a full example of a situation which causes this to fail below:

EXAMPLE OF BUG: lineEnding = `#@#@#`, lines = `Value_1,Value_2,Value#3#@#@#Value_4,Value_5,Value_6`

BAD OUTPUT: `Value_1` `Value_2` `Value#3#@#@#Value_4` `Value_5` `Value_6`

CORRECT OUTPUT: `Value_1` `Value_2` `Value#3`
                `Value_4` `Value_5` `Value_6`

No further details from BATCH-2792

@spring-projects-issues spring-projects-issues added type: bug status: waiting-for-triage Issues that we did not analyse yet labels Dec 16, 2019
@fmbenhassine fmbenhassine added in: infrastructure and removed status: waiting-for-triage Issues that we did not analyse yet labels Apr 23, 2024
@fmbenhassine fmbenhassine added this to the 5.2.0-M1 milestone Apr 23, 2024
@fmbenhassine fmbenhassine added for: backport-to-5.0.x Issues that will be back-ported to the 5.0.x line for: backport-to-5.1.x Issues that will be back-ported to the 5.1.x line labels Apr 23, 2024
@fmbenhassine fmbenhassine changed the title SimpleBinaryBufferedReaderFactory misses line endings [BATCH-2792] SimpleBinaryBufferedReaderFactory misses line endings Apr 23, 2024
This was referenced Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: backport-to-5.0.x Issues that will be back-ported to the 5.0.x line for: backport-to-5.1.x Issues that will be back-ported to the 5.1.x line in: infrastructure type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants