-
Notifications
You must be signed in to change notification settings - Fork 914
Allow SDK to build on JDK 17 #3037
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "", | ||
"type": "feature", | ||
"description": "Update SDK to be able to successfully build using JDK 17." | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ public static EnvironmentVariableCredentialsProvider create() { | |
protected Optional<String> loadSetting(SystemSetting setting) { | ||
// CHECKSTYLE:OFF - Customers should be able to specify a credentials provider that only looks at the environment | ||
// variables, but not the system properties. For that reason, we're only checking the environment variable here. | ||
return Optional.ofNullable(System.getenv(setting.environmentVariable())); | ||
return SystemSetting.getStringValueFromEnvironmentVariable(setting.environmentVariable()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note for reviewer: Non-Mockito change. This uses SystemSetting to support mocking. |
||
// CHECKSTYLE:ON | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,7 @@ private Boolean parseBooleanProperty(String propertyKey, String property) { | |
* Retrieve an unmodifiable view of all of the properties currently in this profile. | ||
*/ | ||
public Map<String, String> properties() { | ||
return properties; | ||
return Collections.unmodifiableMap(properties); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still require wrapping the input list as unmodifiableMap in builder line number 193 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! I didn't see that (and neither did spotbugs). |
||
} | ||
|
||
@Override | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for reviewers: This was modified to really push people to use SystemSetting, because that's the only mechanism that supports environment variable mocking, now. We expect everyone to create new SystemSettings to support both properties and environment variables. If they really want to break that, then they can use the static
SystemSetting.getStringValueFromEnvironmentVariable
(long to be annoying to write), and they still have to add a checkstyle suppression to do it.