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

Feature/#333 open fafreplay #857

Merged
merged 1 commit into from
Apr 7, 2018
Merged

Conversation

micheljung
Copy link
Member

No description provided.

@ghost ghost assigned micheljung Apr 6, 2018
@ghost ghost added the in progress label Apr 6, 2018
@micheljung micheljung force-pushed the feature/#333-open-fafreplay branch 2 times, most recently from f01f5c2 to b7a9da4 Compare April 6, 2018 13:26
@1-alex98
Copy link
Member

1-alex98 commented Apr 6, 2018

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);
Copy link
Member

Choose a reason for hiding this comment

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

should you not '{}'?

Copy link
Member

@1-alex98 1-alex98 Apr 6, 2018

Choose a reason for hiding this comment

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

or rather %s

Copy link
Member Author

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;
Copy link
Member Author

Choose a reason for hiding this comment

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

While this will break the ability to use the application without the install4j runtime, we no longer ship or create archives without install4j. See #855 and #856

private void onStartup(String parameters) {
log.debug("Handling startup: {}", parameters);
if (parameters.split("\" \"").length > 2) {
throw new IllegalArgumentException("Can't handle multiple files: " + parameters);
Copy link
Member Author

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.

@micheljung micheljung merged commit bfb5e28 into develop Apr 7, 2018
@ghost ghost removed the in progress label Apr 7, 2018
@micheljung
Copy link
Member Author

micheljung commented Apr 7, 2018

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?

Then it will start the replay

@Brutus5000 Brutus5000 deleted the feature/#333-open-fafreplay branch March 30, 2019 20:23
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.

None yet

2 participants