-
Notifications
You must be signed in to change notification settings - Fork 695
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
Removed usage of Guava #603
Conversation
To secure a future upgrade in core.
@@ -129,7 +131,7 @@ public void sendInput(byte[] input) { | |||
|
|||
public boolean slurpOutput(FastPipedOutputStream stdout, FastPipedOutputStream stderr) throws IOException { | |||
LOGGER.log(Level.FINE, () -> "--> SlurpOutput"); | |||
ImmutableMap<String, FastPipedOutputStream> streams = ImmutableMap.of("stdout", stdout, "stderr", stderr); | |||
Map<String, FastPipedOutputStream> streams = new HashMap<>(); streams.put("stdout", stdout); streams.put("stderr", stderr); |
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.
It's not an immutable but I think it's fine. We only use it internally. Maybe you can initialize to 2 elements, as they're the only elements we will use
@@ -21,7 +20,7 @@ public OpenShellRequest(URL url) { | |||
|
|||
protected void construct() { | |||
try { | |||
defaultHeader().action(new URI("http://schemas.xmlsoap.org/ws/2004/09/transfer/Create")).resourceURI(new URI("http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd")).options(ImmutableList.of(new Option("WINRS_NOPROFILE", "FALSE"), new Option("WINRS_CODEPAGE", "437"))); | |||
defaultHeader().action(new URI("http://schemas.xmlsoap.org/ws/2004/09/transfer/Create")).resourceURI(new URI("http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd")).options(Arrays.asList(new Option("WINRS_NOPROFILE", "FALSE"), new Option("WINRS_CODEPAGE", "437"))); |
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.
It's not immutable as before but we don't use the list afterwards anyway.
|
||
Header(String to, String replyTo, String maxEnvelopeSize, String timeout, String locale, String id, String action, String shellId, String resourceURI, ImmutableList<Option> optionSet) { | ||
Header(String to, String replyTo, String maxEnvelopeSize, String timeout, String locale, String id, String action, String shellId, String resourceURI, List<Option> optionSet) { |
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.
Better API
@@ -27,7 +29,7 @@ | |||
this.action = action; | |||
this.shellId = shellId; | |||
this.resourceURI = resourceURI; | |||
this.optionSet = optionSet; | |||
this.optionSet = optionSet != null ? Collections.unmodifiableList(new ArrayList<>(optionSet)) : Collections.emptyList(); |
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.
👏🏽
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.
I agree with Ramon that dropping immutable in all these cases do not matter, so LGTM
@res0nance Thanks for merging! |
Hey @rsandell, I'm good to release whenever but #602 seems to have received a comment, might be worth checking it out. I don't think there is too much urgency around Guava removal but yes we definitely want users to start adopting this version before core(hopefully) manages to remove it. |
@res0nance the comment on #602 is ok, you can go ahead and release the plugin. |
To secure a future upgrade in core.