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

De-static IceAdapter class #64

Merged
merged 1 commit into from
Nov 30, 2024
Merged

Conversation

Brutus5000
Copy link
Member

Prepare a slow transition from static-everything to dependency injection

Stripped out of #38

@@ -99,10 +99,10 @@ public void initStaticVariables() {

runOnUIThread(() -> {
controller.versionLabel.setText("Version: %s".formatted(IceAdapter.VERSION));
Copy link
Contributor

@GodFuper GodFuper Nov 28, 2024

Choose a reason for hiding this comment

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

why not IceAdapter.getVersion()

Copy link
Member Author

Choose a reason for hiding this comment

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

Because I ported the old commit and things have changed since then 😛 Will fix

public static void init() {
log.info("Creating RPC server on port {}", IceAdapter.RPC_PORT);
public static void init(int port) {
Debug.RPC_PORT = port;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why RPC_PORT not in RPCService?

Copy link
Member Author

@Brutus5000 Brutus5000 Nov 28, 2024

Choose a reason for hiding this comment

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

same as below

loadOptions(iceOptions);
Debug.DELAY_UI_MS = iceOptions.getDelayUi();
Debug.ENABLE_DEBUG_WINDOW = iceOptions.isDebugWindow();
Debug.ENABLE_INFO_WINDOW = iceOptions.isInfoWindow();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we create a new static variable if we have it in IceOptions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will come in a later commit ;) One thing at a time.

Prepare a slow transition from static-everything to dependency injection
@Brutus5000 Brutus5000 force-pushed the feature/destatic-iceadapter-class branch from a509f31 to a0aa9ca Compare November 28, 2024 19:30
@Brutus5000
Copy link
Member Author

@GodFuper Okay I made all static variables of IceAdapter class private now, with restricted access via (still static) getters.

If you look into the original PR, I try to go one class at a time, so the review scope is smaller and I don't intentionally introduce different behavior.

@Brutus5000 Brutus5000 mentioned this pull request Nov 30, 2024
@Brutus5000 Brutus5000 merged commit 551a55f into master Nov 30, 2024
2 checks passed
@Brutus5000 Brutus5000 deleted the feature/destatic-iceadapter-class branch December 6, 2024 19:12
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