From 97f906eb738bab2ab4467a59fba09fc6b3454587 Mon Sep 17 00:00:00 2001 From: jestin Date: Wed, 24 Feb 2016 20:39:43 +0000 Subject: Integrates G. Alliger's fix ! Kudos to him Add ignore ipv6 --- src/SelfIvyClient.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/SelfIvyClient.java') diff --git a/src/SelfIvyClient.java b/src/SelfIvyClient.java index fbf4927..2751c92 100644 --- a/src/SelfIvyClient.java +++ b/src/SelfIvyClient.java @@ -65,7 +65,7 @@ public class SelfIvyClient extends IvyClient { synchronized (threadedFlag) { threadedFlag.put(key,type); // use autoboxing of boolean } - return key; + return key.intValue(); } catch (PatternSyntaxException ree) { throw new IvyException("Invalid regexp " + sregexp); } @@ -73,14 +73,14 @@ public class SelfIvyClient extends IvyClient { protected synchronized void unBindMsg(int id) throws IvyException { Integer key = id; - /*synchronized (regexps) { synchronized (callbacks) { synchronized (threadedFlag) {*/ + synchronized (regexps) { synchronized (callbacks) { synchronized (threadedFlag) { if ( ( regexps.remove(key) == null ) || (regexpsText.remove(key) == null ) || (callbacks.remove(key) == null ) || (threadedFlag.remove(key) == null ) ) throw new IvyException("client wants to remove an unexistant regexp "+id); - /*} } }*/ + } } } } // unbinds to the first regexp @@ -90,7 +90,7 @@ public class SelfIvyClient extends IvyClient { for (Map.Entry me : regexpsText.entrySet()) { if ( me.getValue().equals(re) ) { try { - bus.unBindMsg(me.getKey()); + bus.unBindMsg(me.getKey().intValue()); } catch (IvyException ie) { return false; } @@ -101,7 +101,7 @@ public class SelfIvyClient extends IvyClient { return false; } - protected synchronized int sendSelfMsg(String message) { + protected int sendSelfMsg(String message) { int count = 0; traceDebug("trying to send to self the message <"+message+">"); for (Integer key : regexps.keySet() ) { @@ -128,7 +128,7 @@ public class SelfIvyClient extends IvyClient { callback=callbacks.get(key); } if (callback==null) { - traceDebug("Not regexp matching id "+key+", it must have been unsubscribed concurrently"); + traceDebug("Not regexp matching id "+key.intValue()+", it must have been unsubscribed concurrently"); return; // DONE check that nasty synchro issue, test suite: Request } -- cgit v1.1