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

BATCH-2407 Use StringBuilder instead of StringBuffer #378

Closed
wants to merge 1 commit into from

Conversation

marschall
Copy link
Contributor

With Java 1.5 StringBuilder is preferred over StringBuffer for single
threaded access as is has less overhead.

This is evidenced by the class comment of StringBuffer and Effective
Java 2nd Edition Item 67: Avoid excessive synchronization.

The StringBuilder class should generally be used in preference to
this one, as it supports all of the same operations but it is faster,
as it performs no synchronization.

  • replace StringBuffer with StringBuilder where possible

Issue: BATCH-2407

@marschall
Copy link
Contributor Author

I have signed and agree to the terms of the SpringSource Individual
Contributor License Agreement.

@mminella mminella self-assigned this Jul 31, 2015
@mminella
Copy link
Member

There are a large number of tests failing with this PR. Please be sure to perform a full build before submitting a pull request $ ./gradlew clean build

With Java 1.5 StringBuilder is preferred over StringBuffer for single
threaded access as is has less overhead.

This is evidenced by the class comment of StringBuffer and Effective
Java 2nd Edition Item 67: Avoid excessive synchronization.

> The StringBuilder class should generally be used in preference to
> this one, as it supports all of the same operations but it is faster,
> as it performs no synchronization.

 - replace StringBuffer with StringBuilder where possible

Issue: BATCH-2407
@marschall
Copy link
Contributor Author

I fixed the tests and rebased and amended.

FaultTolerantStepFactoryBeanRollbackTests.testMultithreadedSkipInWriter() fails from time to time but does so on 3.0.x as well. I assume that's a normal threading issue not related to this change but maybe related to the non-atomic increment operations in StepContribution

@mminella
Copy link
Member

mminella commented Aug 6, 2015

Merged. 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.

None yet

2 participants