summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES12
-rw-r--r--cs/src/Ice/Instance.cs3
-rw-r--r--java/src/IceInternal/Instance.java3
-rw-r--r--php/src/IcePHP/Communicator.cpp17
-rw-r--r--php/src/IcePHP/Properties.cpp11
-rw-r--r--py/modules/IcePy/Communicator.cpp11
-rw-r--r--py/modules/IcePy/Properties.cpp9
-rw-r--r--py/python/Ice.py2
-rw-r--r--rb/src/IceRuby/Communicator.cpp12
-rw-r--r--rb/src/IceRuby/Properties.cpp10
10 files changed, 67 insertions, 23 deletions
diff --git a/CHANGES b/CHANGES
index 6a1bd428966..4e038d17ad9 100644
--- a/CHANGES
+++ b/CHANGES
@@ -66,6 +66,11 @@ Ruby Changes
- Fixed a compilation error when using Ruby 1.8.7 (patch level >=
248).
+- Fixed the Ice.initialize(), Ice.initialize(Ice.InitializationData)
+ and Ice.createProperties() overloads in Python, Ruby and PHP to
+ match the C++, .NET and Java behavior. These overloads no longer
+ read the ICE_CONFIG environment variable.
+
======================================================================
Changes since version 3.3.1
@@ -328,13 +333,6 @@ noted.
- Changed the format of the default logger output. Traces are now
prepended by '--', warnings by '-!' and errors by '!!'.
-- All permutations of Ice.initialize() will now recognize the value of
- the ICE_CONFIG environment variable as long as an already-created
- property set has not been passed in the InitializationData or an
- Ice.Config argument/property has not been set. Previously if the
- no-argument version of initialize was used, ICE_CONFIG was ignored
- in C++, .NET and Java but used in Python and Ruby.
-
- The value of the thread pool SizeWarn property is now 0 by default
rather than 80% of Size. This means that by default warnings about
thread pool growth will now be disabled.
diff --git a/cs/src/Ice/Instance.cs b/cs/src/Ice/Instance.cs
index 4ce75ced6e9..94904edb5c6 100644
--- a/cs/src/Ice/Instance.cs
+++ b/cs/src/Ice/Instance.cs
@@ -592,8 +592,7 @@ namespace IceInternal
{
if(_initData.properties == null)
{
- string[] args = new string[0];
- _initData.properties = Ice.Util.createProperties(ref args);
+ _initData.properties = Ice.Util.createProperties();
}
lock(_staticLock)
diff --git a/java/src/IceInternal/Instance.java b/java/src/IceInternal/Instance.java
index f479ef22189..fe5c3427310 100644
--- a/java/src/IceInternal/Instance.java
+++ b/java/src/IceInternal/Instance.java
@@ -538,8 +538,7 @@ public final class Instance
{
if(_initData.properties == null)
{
- String[] args = new String[0];
- _initData.properties = Ice.Util.createProperties(new Ice.StringSeqHolder(args));
+ _initData.properties = Ice.Util.createProperties();
}
synchronized(Instance.class)
diff --git a/php/src/IcePHP/Communicator.cpp b/php/src/IcePHP/Communicator.cpp
index 42a43677acc..27f8b7a004b 100644
--- a/php/src/IcePHP/Communicator.cpp
+++ b/php/src/IcePHP/Communicator.cpp
@@ -767,11 +767,20 @@ createCommunicator(zval* zv, const ActiveCommunicatorPtr& ac TSRMLS_DC)
}
static CommunicatorInfoIPtr
-initializeCommunicator(zval* zv, Ice::StringSeq& args, const Ice::InitializationData& initData TSRMLS_DC)
+initializeCommunicator(zval* zv, Ice::StringSeq& args, bool hasArgs, const Ice::InitializationData& initData TSRMLS_DC)
{
try
{
- Ice::CommunicatorPtr c = Ice::initialize(args, initData);
+ Ice::CommunicatorPtr c;
+ if(hasArgs)
+ {
+ c = Ice::initialize(args, initData);
+ }
+ else
+ {
+ c = Ice::initialize(initData);
+ }
+
ActiveCommunicatorPtr ac = new ActiveCommunicator(c);
//
@@ -834,6 +843,7 @@ ZEND_FUNCTION(Ice_initialize)
// initialize(InitializationData)
// initialize()
//
+ bool hasArgs = false;
if(ZEND_NUM_ARGS())
{
if(Z_TYPE_PP(args[0]) == IS_ARRAY)
@@ -842,6 +852,7 @@ ZEND_FUNCTION(Ice_initialize)
{
RETURN_NULL();
}
+ hasArgs = true;
if(ZEND_NUM_ARGS() > 1)
{
if(Z_TYPE_PP(args[1]) != IS_OBJECT || Z_OBJCE_PP(args[1]) != initClass)
@@ -896,7 +907,7 @@ ZEND_FUNCTION(Ice_initialize)
}
}
- CommunicatorInfoIPtr info = initializeCommunicator(return_value, seq, initData TSRMLS_CC);
+ CommunicatorInfoIPtr info = initializeCommunicator(return_value, seq, hasArgs, initData TSRMLS_CC);
if(!info)
{
RETURN_NULL();
diff --git a/php/src/IcePHP/Properties.cpp b/php/src/IcePHP/Properties.cpp
index 66c49f8569d..df83ef4517c 100644
--- a/php/src/IcePHP/Properties.cpp
+++ b/php/src/IcePHP/Properties.cpp
@@ -555,7 +555,16 @@ ZEND_FUNCTION(Ice_createProperties)
try
{
- Ice::PropertiesPtr props = Ice::createProperties(seq, defaults);
+ Ice::PropertiesPtr props;
+ if(arglist || defaults)
+ {
+ props = Ice::createProperties(seq, defaults);
+ }
+ else
+ {
+ props = Ice::createProperties();
+ }
+
if(!createProperties(return_value, props TSRMLS_CC))
{
RETURN_NULL();
diff --git a/py/modules/IcePy/Communicator.cpp b/py/modules/IcePy/Communicator.cpp
index f504520a574..bc84904b4a7 100644
--- a/py/modules/IcePy/Communicator.cpp
+++ b/py/modules/IcePy/Communicator.cpp
@@ -134,7 +134,7 @@ communicatorInit(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/)
//
// Use the with-args or the without-args version of initialize()?
//
- bool hasArgs = !seq.empty();
+ bool hasArgs = argList != 0;
Ice::InitializationData data;
if(initData)
@@ -167,7 +167,14 @@ communicatorInit(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/)
try
{
- data.properties = Ice::createProperties(seq, data.properties);
+ if(argList)
+ {
+ data.properties = Ice::createProperties(seq, data.properties);
+ }
+ else if(!data.properties)
+ {
+ data.properties = Ice::createProperties();
+ }
}
catch(const Ice::Exception& ex)
{
diff --git a/py/modules/IcePy/Properties.cpp b/py/modules/IcePy/Properties.cpp
index c7d90d886bc..d7d96e418b2 100644
--- a/py/modules/IcePy/Properties.cpp
+++ b/py/modules/IcePy/Properties.cpp
@@ -96,7 +96,14 @@ propertiesInit(PropertiesObject* self, PyObject* args, PyObject* /*kwds*/)
Ice::PropertiesPtr props;
try
{
- props = Ice::createProperties(seq, defaults);
+ if(defaults || (arglist && arglist != Py_None))
+ {
+ props = Ice::createProperties(seq, defaults);
+ }
+ else
+ {
+ props = Ice::createProperties();
+ }
}
catch(const Ice::Exception& ex)
{
diff --git a/py/python/Ice.py b/py/python/Ice.py
index ab9dfcf5184..aeead0e5bcc 100644
--- a/py/python/Ice.py
+++ b/py/python/Ice.py
@@ -706,7 +706,7 @@ class PropertiesI(Properties):
#
# Ice.createProperties()
#
-def createProperties(args=[], defaults=None):
+def createProperties(args=None, defaults=None):
'''Creates a new property set. The optional arguments represent
an argument list (such as sys.argv) and a property set that supplies
default values. You can invoke this function as follows:
diff --git a/rb/src/IceRuby/Communicator.cpp b/rb/src/IceRuby/Communicator.cpp
index 9a78f0346ab..c52bc4595ca 100644
--- a/rb/src/IceRuby/Communicator.cpp
+++ b/rb/src/IceRuby/Communicator.cpp
@@ -100,7 +100,7 @@ IceRuby_initialize(int argc, VALUE* argv, VALUE self)
//
// Use the with-args or the without-args version of initialize()?
//
- bool hasArgs = !seq.empty();
+ bool hasArgs = !NIL_P(args);
Ice::InitializationData data;
if(!NIL_P(initData))
@@ -126,8 +126,14 @@ IceRuby_initialize(int argc, VALUE* argv, VALUE self)
volatile VALUE progName = callRuby(rb_gv_get, "$0");
seq.insert(seq.begin(), getString(progName));
- data.properties = Ice::createProperties(seq, data.properties);
-
+ if(hasArgs)
+ {
+ data.properties = Ice::createProperties(seq, data.properties);
+ }
+ else if(!data.properties)
+ {
+ data.properties = Ice::createProperties();
+ }
//
// Disable collocation optimization, otherwise an invocation on a
// collocated servant results in a CollocationOptimizationException
diff --git a/rb/src/IceRuby/Properties.cpp b/rb/src/IceRuby/Properties.cpp
index 575fc4cf831..6ac1d27484c 100644
--- a/rb/src/IceRuby/Properties.cpp
+++ b/rb/src/IceRuby/Properties.cpp
@@ -54,7 +54,15 @@ IceRuby_createProperties(int argc, VALUE* argv, VALUE self)
volatile VALUE progName = callRuby(rb_gv_get, "$0");
seq.insert(seq.begin(), getString(progName));
- Ice::PropertiesPtr obj = Ice::createProperties(seq, defaults);
+ Ice::PropertiesPtr obj;
+ if(argc >= 1)
+ {
+ obj = Ice::createProperties(seq, defaults);
+ }
+ else
+ {
+ obj = Ice::createProperties();
+ }
//
// Replace the contents of the given argument list with the filtered arguments.