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

[SHRINKRES-325] Migrating Java language level to Java 8 #189

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

petrberan
Copy link
Member

@@ -67,7 +67,7 @@ private void verifyBuildContent(boolean shouldContain) {
}

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

@@ -32,7 +34,7 @@ public class ConfigurationStageTestCase {
put("propertyKey1", "propertyValue1");
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
1 check passed
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