Skip to content

Conversation

@ajacob
Copy link
Contributor

@ajacob ajacob commented Jan 27, 2026

Issue: #590

Problem

When calling StaEDIStreamReader.getTransactionType() on the second transaction of an EDI file on START_TRANSACTION event, we get an IllegalStateException

Solution

The purpose of this PR is to fix StaEDIStreamReader to make sure the lexer parse enough data to allow
retrieval of transaction type information

**Problem**

When calling `StaEDIStreamReader.getTransactionType()` on
the second transaction of an EDI file on `START_TRANSACTION`
event, we get an `IllegalStateException`

**Solution**

The purpose of this PR is to fix `StaEDIStreamReader`
to make sure the lexer parse enough data to allow
retrieval of transaction type information
@MikeEdgar MikeEdgar added this to the v1.26.1 milestone Jan 27, 2026
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)
2 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@MikeEdgar MikeEdgar linked an issue Jan 27, 2026 that may be closed by this pull request
Copy link
Member

@MikeEdgar MikeEdgar left a comment

Choose a reason for hiding this comment

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

Thank you for the issue and also for digging in and providing a fix! Don't worry about the Sonar issues, this looks good to me. I assume you'd like a release with the fix, so that will be coming shortly.

@MikeEdgar MikeEdgar merged commit 6559cb5 into xlate:master Jan 27, 2026
12 of 13 checks passed
@ajacob
Copy link
Contributor Author

ajacob commented Jan 27, 2026

Thank you for your almost instant reply @MikeEdgar!
I was testing the lib against a few simple EDI files and found this bug a bit randomly, a release could be fine for me to continue my tests but if you need other changes to go into the next release I can wait

@MikeEdgar
Copy link
Member

I was testing the lib against a few simple EDI files and found this bug a bit randomly, a release could be fine for me to continue my tests but if you need other changes to go into the next release I can wait

It's simple enough to do a release and better to have it out.

@ajacob
Copy link
Contributor Author

ajacob commented Jan 27, 2026

Amazing, many 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.

IllegalStateException when trying to get the second transaction type

2 participants