Skip to content

StaxEventItemReader#isFragmentRootElementName method should be protected #1020

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

Closed
spring-projects-issues opened this issue Mar 20, 2017 · 1 comment

Comments

@spring-projects-issues
Copy link
Collaborator

Balan opened BATCH-2583 and commented

I was looking up to customize the method moveCursorToNextFragment in StaxEventItemReader and I noticed this method uses isFragmentRootElementName which is currently a private method. In my opinion, if caller is 'protected', the callee should have been made 'protected' as well.


Affects: 3.0.7

@fmbenhassine
Copy link
Contributor

In my opinion, if caller is 'protected', the callee should have been made 'protected' as well.

That's not necessarily true, because if that private method calls another private method which in turn calls yet another private method, we would transitively need to make all of them protected and end up opening the entire class for extension.

As a second example, the jumpToItem is protected and calls readToStartFragment and readToEndFragment which are private. I don't think these two methods should necessarily be made protected.

That said, I see an added value in making StaxEventItemReader#isFragmentRootElementName protected to be able to override the logic in there.

@fmbenhassine fmbenhassine removed the status: waiting-for-triage Issues that we did not analyse yet label Mar 2, 2020
@fmbenhassine fmbenhassine added this to the 4.3.0 milestone Mar 2, 2020
@fmbenhassine fmbenhassine self-assigned this May 28, 2020
@fmbenhassine fmbenhassine changed the title isFragmentRootElementName method access modifier should be protected [BATCH-2583] StaxEventItemReader#isFragmentRootElementName method should be protected Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants