summaryrefslogtreecommitdiff
path: root/java-compat/src
diff options
context:
space:
mode:
Diffstat (limited to 'java-compat/src')
-rw-r--r--java-compat/src/Ice/src/main/java/Ice/ConnectionI.java4
-rw-r--r--java-compat/src/Ice/src/main/java/IceInternal/ACMConfig.java5
2 files changed, 9 insertions, 0 deletions
diff --git a/java-compat/src/Ice/src/main/java/Ice/ConnectionI.java b/java-compat/src/Ice/src/main/java/Ice/ConnectionI.java
index 9c4c4c45e16..8b334e9db6e 100644
--- a/java-compat/src/Ice/src/main/java/Ice/ConnectionI.java
+++ b/java-compat/src/Ice/src/main/java/Ice/ConnectionI.java
@@ -701,6 +701,10 @@ public final class ConnectionI extends IceInternal.EventHandler
synchronized public void setACM(Ice.IntOptional timeout, Ice.Optional<ACMClose> close,
Ice.Optional<ACMHeartbeat> heartbeat)
{
+ if(timeout != null && timeout.isSet() && timeout.get() < 0)
+ {
+ throw new IllegalArgumentException("invalid negative ACM timeout value");
+ }
if(_monitor == null || _state >= StateClosed)
{
return;
diff --git a/java-compat/src/Ice/src/main/java/IceInternal/ACMConfig.java b/java-compat/src/Ice/src/main/java/IceInternal/ACMConfig.java
index 7864e99f88e..3c34b4cbfc0 100644
--- a/java-compat/src/Ice/src/main/java/IceInternal/ACMConfig.java
+++ b/java-compat/src/Ice/src/main/java/IceInternal/ACMConfig.java
@@ -34,6 +34,11 @@ public final class ACMConfig implements java.lang.Cloneable
}
timeout = p.getPropertyAsIntWithDefault(timeoutProperty, dflt.timeout / 1000) * 1000; // To milliseconds
+ if(timeout < 0)
+ {
+ l.warning("invalid value for property `" + timeoutProperty + "', default value will be used instead");
+ timeout = dflt.timeout;
+ }
int hb = p.getPropertyAsIntWithDefault(prefix + ".Heartbeat", dflt.heartbeat.ordinal());
Ice.ACMHeartbeat[] heartbeatValues = Ice.ACMHeartbeat.values();