Skip to content

Conversation

@pepone
Copy link
Member

@pepone pepone commented Oct 28, 2025

This PR updates the demos to use the communicator constructor instead of Ice.initialize in languages where communicator constructor is public.

Copy link

Copilot AI left a 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() with Ice.Communicator() constructor across all language bindings
  • Replace Ice.createProperties() with Ice.Properties() constructor in Python and JavaScript demos
  • Remove unused Ice.Util imports 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

import com.zeroc.Ice.Communicator;
import com.zeroc.Ice.Util;

class Client {

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()

Choose a reason for hiding this comment

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

Should just be:

Suggested change
communicator = Ice.Communicator()
communicator = new Communicator()

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.

Copy link
Member Author

@pepone pepone Oct 28, 2025

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()

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!

@pepone pepone merged commit c36e770 into zeroc-ice:main Oct 29, 2025
16 of 17 checks passed
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.

3 participants