private static String makeThreadName ( String suffix ) { String name = Thread . currentThread ( ) . getName ( ) . replaceAll ( "-EventThread" , "" ) ; return name + suffix ; }
Guard against creating - EventThread - EventThread - EventThread - ... thread names when ZooKeeper object is being created from within a watcher . See ZOOKEEPER - 795 for details .