-
Couldn't load subscription status.
- Fork 216
Communicator constructor #652
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
Conversation
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.
Pull Request Overview
This PR updates demo applications across multiple languages (Python, JavaScript, Java, C#, and Kotlin) to use the new Communicator constructor instead of the deprecated initialize() factory functions. It also replaces deprecated createProperties() calls with the Properties constructor.
Key changes:
- Replace
Ice.initialize()withIce.Communicator()constructor across all language bindings - Replace
Ice.createProperties()withIce.Properties()constructor in Python and JavaScript demos - Remove unused
Ice.Utilimports in Java demos - Update associated comments to reflect the new initialization pattern
Reviewed Changes
Copilot reviewed 142 out of 142 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/*/*/main.py | Replace Ice.initialize() and Ice.createProperties() with constructors |
| js/*/*.ts | Replace Ice.initialize() with new Ice.Communicator() constructor |
| java/*/*/*.java | Replace Util.initialize() with new Communicator() and remove unused imports |
| csharp/*/*/Program.cs | Replace Ice.Util.initialize() with new Ice.Communicator() constructor |
| java/Ice/android-greeter/app/src/main/java/com/example/ice/androidgreeter/App.kt | Replace Util.initialize() with new Ice.Communicator() in Kotlin |
java/Ice/cancellation/server/src/main/java/com/example/ice/cancellation/server/Server.java
Outdated
Show resolved
Hide resolved
java/Ice/android-greeter/app/src/main/java/com/example/ice/androidgreeter/App.kt
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
…cellation/server/Server.java Co-authored-by: Copilot <[email protected]>
…roidgreeter/App.kt Co-authored-by: Copilot <[email protected]>
| import com.zeroc.Ice.Communicator; | ||
| import com.zeroc.Ice.Util; | ||
|
|
||
| class Client { |
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.
An extra line was deleted here (why the Java formatter is angry).
| override fun onCreate() { | ||
| super.onCreate() | ||
| communicator = Util.initialize() | ||
| communicator = Ice.Communicator() |
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 just be:
| communicator = Ice.Communicator() | |
| communicator = new Communicator() |
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.
Also looks like you can remove the import com.zeroc.Ice.Util from this file too.
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 removed the import, new is not used in Kotlin so it should be just Communicator()
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.
Ah, missed that this was Kotlin!
This PR updates the demos to use the communicator constructor instead of Ice.initialize in languages where communicator constructor is public.