-
Notifications
You must be signed in to change notification settings - Fork 117
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
Feature/#333 open fafreplay #857
Conversation
f01f5c2
to
b7a9da4
Compare
b7a9da4
to
39ed5ea
Compare
You really wann have the 5$ right ;), what if I right click on the file and say open with when the client is already running? |
private void onStartup(String parameters) { | ||
log.debug("Handling startup: {}", parameters); | ||
if (parameters.split("\" \"").length > 2) { | ||
throw new IllegalArgumentException("Can't handle multiple files: " + parameters); |
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.
should you not '{}'?
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.
or rather %s
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.
Exceptions don't support string formatting. I had to do:
throw new IllegalArgumentException(String.format("Can't handle multiple files: %s", parameters));
but with simple concatenations like this, I don't see the benefit. With more/complex parameters, I would agree.
package com.faforever.client.os; | ||
|
||
import com.faforever.client.replay.ReplayService; | ||
import com.install4j.api.launcher.StartupNotification; |
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.
private void onStartup(String parameters) { | ||
log.debug("Handling startup: {}", parameters); | ||
if (parameters.split("\" \"").length > 2) { | ||
throw new IllegalArgumentException("Can't handle multiple files: " + parameters); |
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.
Exceptions don't support string formatting. I had to do:
throw new IllegalArgumentException(String.format("Can't handle multiple files: %s", parameters));
but with simple concatenations like this, I don't see the benefit. With more/complex parameters, I would agree.
Then it will start the replay |
No description provided.