Skip to content

Commit

Permalink
Remove stringToIdentity (#1649)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Jan 9, 2024
1 parent 59b36a0 commit 9f46243
Show file tree
Hide file tree
Showing 20 changed files with 6 additions and 189 deletions.
24 changes: 0 additions & 24 deletions cpp/include/Ice/Communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,22 +209,10 @@ class ICE_CLASS(ICE_API) Communicator
*/
virtual ::Ice::PropertyDict proxyToProperty(const ::std::shared_ptr<ObjectPrx>& proxy, const ::std::string& property) const = 0;

/**
* Convert a string into an identity. If the string does not parse correctly, the operation throws
* IdentityParseException.
* @param str The string to convert into an identity.
* @return The identity.
* @see #identityToString
*
* @deprecated stringToIdentity() is deprecated, use the static stringToIdentity() method instead.
*/
ICE_DEPRECATED_API("stringToIdentity() is deprecated, use the static stringToIdentity() method instead.") virtual ::Ice::Identity stringToIdentity(const ::std::string& str) const = 0;

/**
* Convert an identity into a string.
* @param ident The identity to convert into a string.
* @return The "stringified" identity.
* @see #stringToIdentity
*/
virtual ::std::string identityToString(const Identity& ident) const = 0;

Expand Down Expand Up @@ -714,22 +702,10 @@ class ICE_API Communicator : public virtual LocalObject
*/
virtual PropertyDict proxyToProperty(const ObjectPrx& proxy, const ::std::string& property) const = 0;

/**
* Convert a string into an identity. If the string does not parse correctly, the operation throws
* IdentityParseException.
* @param str The string to convert into an identity.
* @return The identity.
* @see #identityToString
*
* @deprecated stringToIdentity() is deprecated, use the static stringToIdentity() method instead.
*/
ICE_DEPRECATED_API("stringToIdentity() is deprecated, use the static stringToIdentity() method instead.") virtual Identity stringToIdentity(const ::std::string& str) const = 0;

/**
* Convert an identity into a string.
* @param ident The identity to convert into a string.
* @return The "stringified" identity.
* @see #stringToIdentity
*/
virtual ::std::string identityToString(const Identity& ident) const = 0;

Expand Down
6 changes: 0 additions & 6 deletions cpp/src/Ice/CommunicatorI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,6 @@ Ice::CommunicatorI::proxyToProperty(const ObjectPrxPtr& proxy, const string& pro
return _instance->proxyFactory()->proxyToProperty(proxy, property);
}

Identity
Ice::CommunicatorI::stringToIdentity(const string& s) const
{
return Ice::stringToIdentity(s);
}

string
Ice::CommunicatorI::identityToString(const Identity& ident) const
{
Expand Down
1 change: 0 additions & 1 deletion cpp/src/Ice/CommunicatorI.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class CommunicatorI : public Communicator
virtual ObjectPrxPtr propertyToProxy(const std::string&) const;
virtual PropertyDict proxyToProperty(const ObjectPrxPtr&, const std::string&) const;

virtual Identity stringToIdentity(const std::string&) const;
virtual std::string identityToString(const Identity&) const;

virtual ObjectAdapterPtr createObjectAdapter(const std::string&);
Expand Down
19 changes: 0 additions & 19 deletions csharp/src/Ice/Communicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,25 +141,6 @@ public partial interface Communicator : global::System.IDisposable
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.7.10")]
global::System.Collections.Generic.Dictionary<string, string> proxyToProperty(ObjectPrx proxy, string property);


/// <summary>
/// Convert a string into an identity.
///
/// <para>stringToIdentity() is deprecated, use the static stringToIdentity() method instead.</para>
///
/// If the string does not parse correctly, the operation throws
/// IdentityParseException.
/// </summary>
/// <param name="str">The string to convert into an identity.
/// </param>
/// <returns>The identity.
/// </returns>

[global::System.Obsolete("stringToIdentity() is deprecated, use the static stringToIdentity() method instead.")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("slice2cs", "3.7.10")]
Identity stringToIdentity(string str);


/// <summary>
/// Convert an identity into a string.
/// </summary>
Expand Down
5 changes: 0 additions & 5 deletions csharp/src/Ice/CommunicatorI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ public Dictionary<string, string> proxyToProperty(ObjectPrx proxy, string prefix
return _instance.proxyFactory().proxyToProperty(proxy, prefix);
}

public Identity stringToIdentity(string s)
{
return Util.stringToIdentity(s);
}

public string identityToString(Identity ident)
{
return Util.identityToString(ident, _instance.toStringMode());
Expand Down
5 changes: 1 addition & 4 deletions csharp/test/Ice/proxy/AllTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,8 @@ public static Test.MyClassPrx allTests(global::Test.TestHelper helper)

output.Write("testing proxy methods... ");

// Disable Obsolete warning/error
#pragma warning disable 612, 618
test(communicator.identityToString(
baseProxy.ice_identity(communicator.stringToIdentity("other")).ice_getIdentity()).Equals("other"));
#pragma warning restore 612, 618
baseProxy.ice_identity(Util.stringToIdentity("other")).ice_getIdentity()).Equals("other"));
test(baseProxy.ice_facet("facet").ice_getFacet().Equals("facet"));
test(baseProxy.ice_adapterId("id").ice_getAdapterId().Equals("id"));
test(baseProxy.ice_twoway().ice_isTwoway());
Expand Down
12 changes: 0 additions & 12 deletions java/src/Ice/src/main/java/com/zeroc/Ice/Communicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,6 @@ public interface Communicator extends java.lang.AutoCloseable
**/
java.util.Map<java.lang.String, java.lang.String> proxyToProperty(ObjectPrx proxy, String property);

/**
* Convert a string into an identity. If the string does not parse correctly, the operation throws
* IdentityParseException.
* @param str The string to convert into an identity.
* @return The identity.
*
* @see #identityToString
* @deprecated stringToIdentity() is deprecated, use the static stringToIdentity() method instead.
**/
@Deprecated
Identity stringToIdentity(String str);

/**
* Convert an identity into a string.
* @param ident The identity to convert into a string.
Expand Down
7 changes: 0 additions & 7 deletions java/src/Ice/src/main/java/com/zeroc/Ice/CommunicatorI.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ public final class CommunicatorI implements Communicator
return _instance.proxyFactory().proxyToProperty(proxy, prefix);
}

@Override @SuppressWarnings("deprecation")
public Identity
stringToIdentity(String s)
{
return Util.stringToIdentity(s);
}

@Override
public String
identityToString(Identity ident)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ private java.util.LinkedList<ObjectDescriptor> mapToObjectDescriptorSeq(java.uti
{
try
{
com.zeroc.Ice.Identity id = communicator.stringToIdentity(p.getKey());
com.zeroc.Ice.Identity id = com.zeroc.Ice.Util.stringToIdentity(p.getKey());
String[] val = p.getValue();
result.add(new ObjectDescriptor(id, val[0], val[2]));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ private java.util.LinkedList<ObjectDescriptor> mapToObjectDescriptorSeq(java.uti
{
try
{
com.zeroc.Ice.Identity id = communicator.stringToIdentity(p.getKey());
com.zeroc.Ice.Identity id = com.zeroc.Ice.Util.stringToIdentity(p.getKey());
String[] val = p.getValue();
result.add(new ObjectDescriptor(id, val[0], val[1]));
}
Expand Down
5 changes: 0 additions & 5 deletions js/src/Ice/CommunicatorI.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ class Communicator
return this._instance.proxyFactory().proxyToProperty(proxy, prefix);
}

stringToIdentity(s)
{
return Ice.stringToIdentity(s);
}

identityToString(ident)
{
return Ice.identityToString(ident, this._instance.toStringMode());
Expand Down
1 change: 0 additions & 1 deletion objective-c/include/objc/Ice/Communicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ ICE_API @protocol ICECommunicator <NSObject>
-(NSMutableString*) proxyToString:(id<ICEObjectPrx>)obj;
-(id<ICEObjectPrx>) propertyToProxy:(NSString*)property;
-(ICEMutablePropertyDict*) proxyToProperty:(id<ICEObjectPrx>)proxy property:(NSString*)property;
-(ICEIdentity*) stringToIdentity:(NSString*)str ICE_DEPRECATED_API("stringToIdentity() is deprecated, use the static stringToIdentity() method instead.");
-(NSMutableString*) identityToString:(ICEIdentity*)ident;
-(id<ICEObjectAdapter>) createObjectAdapter:(NSString*)name;
-(id<ICEObjectAdapter>) createObjectAdapterWithEndpoints:(NSString*)name endpoints:(NSString*)endpoints;
Expand Down
5 changes: 0 additions & 5 deletions objective-c/src/Ice/CommunicatorI.mm
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ -(NSMutableDictionary*)proxyToProperty:(id<ICEObjectPrx>)prx property:(NSString*
return nil; // Keep the compiler happy.
}

-(ICEIdentity*) stringToIdentity:(NSString*)str
{
return [ICEUtil stringToIdentity:str];
}

-(NSMutableString*) identityToString:(ICEIdentity*)ident
{
NSException* nsex = nil;
Expand Down
33 changes: 0 additions & 33 deletions php/src/Communicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,38 +511,6 @@ ZEND_METHOD(Ice_Communicator, proxyToProperty)
}
}

ZEND_BEGIN_ARG_INFO_EX(Ice_Communicator_stringToIdentity_arginfo, 1, ZEND_RETURN_VALUE, static_cast<zend_ulong>(1))
ZEND_ARG_INFO(0, str)
ZEND_END_ARG_INFO()

ZEND_METHOD(Ice_Communicator, stringToIdentity)
{
CommunicatorInfoIPtr _this = Wrapper<CommunicatorInfoIPtr>::value(getThis());
assert(_this);

char* str;
size_t strLen;
if(zend_parse_parameters(ZEND_NUM_ARGS(), const_cast<char*>("s"), &str, &strLen) != SUCCESS)
{
RETURN_NULL();
}
string s(str, strLen);

try
{
Ice::Identity id = _this->getCommunicator()->stringToIdentity(s);
if(!createIdentity(return_value, id))
{
RETURN_NULL();
}
}
catch(const IceUtil::Exception& ex)
{
throwException(ex);
RETURN_NULL();
}
}

ZEND_BEGIN_ARG_INFO_EX(Ice_Communicator_identityToString_arginfo, 1, ZEND_RETURN_VALUE, static_cast<zend_ulong>(1))
ZEND_ARG_INFO(0, id)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -1595,7 +1563,6 @@ static zend_function_entry _classMethods[] =
ZEND_ME(Ice_Communicator, proxyToString, Ice_Communicator_proxyToString_arginfo, ZEND_ACC_PUBLIC)
ZEND_ME(Ice_Communicator, propertyToProxy, Ice_Communicator_propertyToProxy_arginfo, ZEND_ACC_PUBLIC)
ZEND_ME(Ice_Communicator, proxyToProperty, Ice_Communicator_proxyToProperty_arginfo, ZEND_ACC_PUBLIC)
ZEND_ME(Ice_Communicator, stringToIdentity, Ice_Communicator_stringToIdentity_arginfo, ZEND_ACC_PUBLIC)
ZEND_ME(Ice_Communicator, identityToString, Ice_Communicator_identityToString_arginfo, ZEND_ACC_PUBLIC)
ZEND_ME(Ice_Communicator, addObjectFactory, Ice_Communicator_addObjectFactory_arginfo, ZEND_ACC_PUBLIC)
ZEND_ME(Ice_Communicator, findObjectFactory, Ice_Communicator_findObjectFactory_arginfo, ZEND_ACC_PUBLIC)
Expand Down
2 changes: 1 addition & 1 deletion php/test/Ice/proxy/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ function allTests($helper)

echo "testing proxy methods... ";
flush();
test($communicator->identityToString($base->ice_identity($communicator->stringToIdentity("other"))->ice_getIdentity()) == "other");
test($communicator->identityToString($base->ice_identity($stringToIdentity("other"))->ice_getIdentity()) == "other");

//
// Verify that ToStringMode is passed correctly
Expand Down
35 changes: 0 additions & 35 deletions python/modules/IcePy/Communicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,39 +715,6 @@ communicatorProxyToProperty(CommunicatorObject* self, PyObject* args)
return result.release();
}

#ifdef WIN32
extern "C"
#endif
static PyObject*
communicatorStringToIdentity(CommunicatorObject* self, PyObject* args)
{
PyObject* strObj;
if(!PyArg_ParseTuple(args, STRCAST("O"), &strObj))
{
return 0;
}

string str;
if(!getStringArg(strObj, "str", str))
{
return 0;
}

assert(self->communicator);
Ice::Identity id;
try
{
id = (*self->communicator)->stringToIdentity(str);
}
catch(const Ice::Exception& ex)
{
setPythonException(ex);
return 0;
}

return createIdentity(id);
}

#ifdef WIN32
extern "C"
#endif
Expand Down Expand Up @@ -1727,8 +1694,6 @@ static PyMethodDef CommunicatorMethods[] =
PyDoc_STR(STRCAST("propertyToProxy(str) -> Ice.ObjectPrx")) },
{ STRCAST("proxyToProperty"), reinterpret_cast<PyCFunction>(communicatorProxyToProperty), METH_VARARGS,
PyDoc_STR(STRCAST("proxyToProperty(Ice.ObjectPrx, str) -> dict")) },
{ STRCAST("stringToIdentity"), reinterpret_cast<PyCFunction>(communicatorStringToIdentity), METH_VARARGS,
PyDoc_STR(STRCAST("stringToIdentity(str) -> Ice.Identity")) },
{ STRCAST("identityToString"), reinterpret_cast<PyCFunction>(communicatorIdentityToString), METH_VARARGS,
PyDoc_STR(STRCAST("identityToString(Ice.Identity) -> string")) },
{ STRCAST("createObjectAdapter"), reinterpret_cast<PyCFunction>(communicatorCreateObjectAdapter), METH_VARARGS,
Expand Down
10 changes: 0 additions & 10 deletions python/python/Ice/Communicator_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,6 @@ def proxyToProperty(self, proxy, property):
"""
raise NotImplementedError("method 'proxyToProperty' not implemented")

def stringToIdentity(self, str):
"""
Convert a string into an identity. If the string does not parse correctly, the operation throws
IdentityParseException.
Arguments:
str -- The string to convert into an identity.
Returns: The identity.
"""
raise NotImplementedError("method 'stringToIdentity' not implemented")

def identityToString(self, ident):
"""
Convert an identity into a string.
Expand Down
3 changes: 1 addition & 2 deletions python/test/Ice/proxy/AllTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ def allTests(helper, communicator, collocated):
sys.stdout.write("testing proxy methods... ")
sys.stdout.flush()

test(communicator.identityToString(base.ice_identity(communicator.stringToIdentity("other")).ice_getIdentity()) \
== "other")
test(communicator.identityToString(base.ice_identity(Ice.stringToIdentity("other")).ice_getIdentity()) == "other")

#
# Verify that ToStringMode is passed correctly
Expand Down
16 changes: 0 additions & 16 deletions ruby/src/IceRuby/Communicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,21 +516,6 @@ IceRuby_Communicator_proxyToProperty(VALUE self, VALUE obj, VALUE str)
return Qnil;
}

extern "C"
VALUE
IceRuby_Communicator_stringToIdentity(VALUE self, VALUE str)
{
ICE_RUBY_TRY
{
Ice::CommunicatorPtr p = getCommunicator(self);
string s = getString(str);
Ice::Identity ident = p->stringToIdentity(s);
return createIdentity(ident);
}
ICE_RUBY_CATCH
return Qnil;
}

extern "C"
VALUE
IceRuby_Communicator_identityToString(VALUE self, VALUE id)
Expand Down Expand Up @@ -757,7 +742,6 @@ IceRuby::initCommunicator(VALUE iceModule)
rb_define_method(_communicatorClass, "proxyToString", CAST_METHOD(IceRuby_Communicator_proxyToString), 1);
rb_define_method(_communicatorClass, "propertyToProxy", CAST_METHOD(IceRuby_Communicator_propertyToProxy), 1);
rb_define_method(_communicatorClass, "proxyToProperty", CAST_METHOD(IceRuby_Communicator_proxyToProperty), 2);
rb_define_method(_communicatorClass, "stringToIdentity", CAST_METHOD(IceRuby_Communicator_stringToIdentity), 1);
rb_define_method(_communicatorClass, "identityToString", CAST_METHOD(IceRuby_Communicator_identityToString), 1);
rb_define_method(_communicatorClass, "addObjectFactory", CAST_METHOD(IceRuby_Communicator_addObjectFactory), 2);
rb_define_method(_communicatorClass, "findObjectFactory", CAST_METHOD(IceRuby_Communicator_findObjectFactory), 1);
Expand Down
2 changes: 1 addition & 1 deletion ruby/test/Ice/proxy/AllTests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def allTests(helper, communicator)

print "testing proxy methods... "
STDOUT.flush
test(communicator.identityToString(base.ice_identity(communicator.stringToIdentity("other")).ice_getIdentity()) == "other")
test(communicator.identityToString(base.ice_identity(Ice::stringToIdentity("other")).ice_getIdentity()) == "other")

#
# Verify that ToStringMode is passed correctly
Expand Down

0 comments on commit 9f46243

Please sign in to comment.