Skip to content

Conversation

@petrberan
Copy link
Member


private void assertBuildStdoutContains(String expectedString, boolean shouldContain){
StringBuffer assertWarn = new StringBuffer("The build output printed on stdout should ");
StringBuilder assertWarn = new StringBuilder("The build output printed on stdout should ");
Copy link
Member

Choose a reason for hiding this comment

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

This has nothing to do with JDK version, and it might be intentional if accessed from multiple threads.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think there's any harm in using the StringBuilder. No other threads are accessing the same instance and StringBuilder should be faster, but in this case I don't mind having the StringBuffer back. Personally, I would keep the StringBuilder

put("propertyKey2", "propertyValue2");
}};
final Map<String, String> shellEnvironments = new HashMap() {{
final Map<String, String> shellEnvironments = new HashMap<String, String>() {{
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
final Map<String, String> shellEnvironments = new HashMap<String, String>() {{
final Map<String, String> shellEnvironments = new HashMap<>() {{

Copy link
Member Author

Choose a reason for hiding this comment

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

This is actually invalid due to the anonymous inner class, new HashMap<>() won't even compile

This would work on JDK 9+, we're still on JDK 8

@petrberan petrberan requested a review from xstefank March 13, 2024 16:06
@xstefank
Copy link
Member

@petrberan needs rebase

@petrberan petrberan merged commit 1e9a888 into shrinkwrap:master Apr 16, 2024
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.

2 participants