Skip to content

[IO-634] Make getCause synchronized and use a Deque instead of a Stack#64

Merged
garydgregory merged 2 commits into
apache:masterfrom
wilx:master-tweaks
Nov 1, 2019
Merged

[IO-634] Make getCause synchronized and use a Deque instead of a Stack#64
garydgregory merged 2 commits into
apache:masterfrom
wilx:master-tweaks

Conversation

@wilx

@wilx wilx commented Aug 31, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@kinow kinow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me! Not merging right now as I haven't figured out why Travis is so broken.

*/
@Override
public IOException getCause() {
public synchronized IOException getCause() {

@kinow kinow Feb 16, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@wilx

wilx commented Oct 31, 2019

Copy link
Copy Markdown
Contributor Author

Ping.

int textIdx = 0;
int wcsIdx = 0;
final Stack<int[]> backtrack = new Stack<>();
final Deque<int[]> backtrack = new ArrayDeque<>(wcs.length);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks reasonable to me. Stack is synchronized I think, while Deque is not. But backtrack is used in this method without any locks, so Stack doesn't appear to be used specifically for that.

@kinow

kinow commented Oct 31, 2019

Copy link
Copy Markdown
Member

@wilx could you rebase your code on master, please? I had a look at Travis, and the build appears to be passing there, while failing for this PR. Hopefully something that was fixed since you created the PR. Then will ping another dev to take a look at the changes (I guess they are small but still deserve an issue for the changelog perhaps?) Thanks

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 89.41% when pulling 05004a7 on wilx:master-tweaks into b0bbc43 on apache:master.

@kinow

kinow commented Oct 31, 2019

Copy link
Copy Markdown
Member

Thanks @wilx ! Build passing on Travis. @garydgregory I haven't looked at commons-io in a while. Would you be able to have another look at this PR and double check if it looks OK, and whether we'd need a JIRA for this or not, please? (no worries if busy, I can drop an e-mail to dev-list later this weekend)

@garydgregory

garydgregory commented Nov 1, 2019

Copy link
Copy Markdown
Member

Yes, we should have a JIRA and this PR needs a description and a title that reflects the changes. The current title "Two small tweaks." is meaningless.

@kinow

kinow commented Nov 1, 2019

Copy link
Copy Markdown
Member

Thanks @garydgregory . @wilx could you create a JIRA and rename the PR, please?

@wilx

wilx commented Nov 1, 2019

Copy link
Copy Markdown
Contributor Author

I will but TBH, reluctantly.

@wilx wilx changed the title Two small tweaks. IO-634 Two small tweaks. Nov 1, 2019
@wilx wilx changed the title IO-634 Two small tweaks. [IO-634] Two small tweaks. Nov 1, 2019
@wilx

wilx commented Nov 1, 2019

Copy link
Copy Markdown
Contributor Author

JIRA issue here: https://issues.apache.org/jira/browse/IO-634

@kinow

kinow commented Nov 1, 2019

Copy link
Copy Markdown
Member

That's just to have the issue in the changelog (when merging we'll add it to changes.xml), so other users will be aware of the changes and know what to look for in case of bugs - even if very unlikely, it can be helpful to see what changed/why.

The title is still vague. What if the PR/issue have a title like "Make getCause synchronized and use a Deque instead of Stack" ? Or something along that line.

@wilx wilx changed the title [IO-634] Two small tweaks. [IO-634] Make getCause synchronized and use a Deque instead of Stack Nov 1, 2019
@garydgregory garydgregory changed the title [IO-634] Make getCause synchronized and use a Deque instead of Stack [IO-634] Make getCause synchronized and use a Deque instead of a Stack Nov 1, 2019
@garydgregory garydgregory merged commit 421b9dc into apache:master Nov 1, 2019
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.

4 participants